monocle-release
monocle-release copied to clipboard
reduced dimension space doesn't match the dimension of the CellDataSet object
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
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?
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 did you get it to work? I'm having the same issue when trying to import
I'm having this issue as well, the tSNE reduction works fine, but not DDRTree.