monocle-release icon indicating copy to clipboard operation
monocle-release copied to clipboard

reduced dimension space doesn't match the dimension of the CellDataSet object

Open VTJ1992 opened this issue 6 years ago • 4 comments

Hi,

I am trying to run the flow work of Monocle but when I am at the step of Cluster your cells I get the following: Error in clusterCells(cds) : reduced dimension space doesn't match the dimension of the CellDataSet object Can anyone tell me what is wrong and how I can change it?

Thank you!

VTJ

VTJ1992 avatar Sep 03 '18 11:09 VTJ1992

I am having this same problem. I am trying to extract data from a Seurat3 object, so I extracted the counts matrix and built the the CellDataSet object from that. Maybe there was a problem with that process?

rlittman16 avatar Mar 15 '19 17:03 rlittman16

Here is the code I used I am going to modify the genes later, this was just to test it out:

counts <- Seurat_object@assays$RNA@data pd <- data.frame(colnames(counts)) rownames(pd) <- pd$colnames.counts. colnames(pd)[1] = "CellName" fd <- data.frame(rownames(counts)) rownames(fd) <- fd$rownames.counts. colnames(fd)[1] = "gene_short_name"

pd <- new("AnnotatedDataFrame", data = pd) fd <- new("AnnotatedDataFrame", data = fd)

cds <- newCellDataSet(counts, phenoData = pd, featureData = fd)

cth <- newCellTypeHierarchy()

P2ry12_id <- row.names(subset(fData(cds), gene_short_name == "P2ry12")) Trem2_id <- row.names(subset(fData(cds), gene_short_name == "Trem2"))

cth <- addCellType(cth, "Homeostatic_Microglia", classify_func = function(x) { x[P2ry12_id,] >= 1}) cth <- addCellType(cth, "Not_Homeostatic_Microglia", classify_func = function(x) { x[P2ry12_id,] < 1})

cds <- classifyCells(cds, cth, 0.1)

cds <- clusterCells(cds)

rlittman16 avatar Mar 15 '19 18:03 rlittman16

@rlittman16 did you get it to work? I'm having the same issue when trying to import

ahdee avatar Apr 08 '20 23:04 ahdee

I'm having this issue as well, the tSNE reduction works fine, but not DDRTree.

Matthew1309 avatar Jan 25 '22 21:01 Matthew1309