monocle-release
monocle-release copied to clipboard
orderCells
I am running monocle 2 to analyse some scATACseq data.
When I run:
data_atac <- GetAssayData(atac_cicero[["ATAC"]], slot="data") pd_atac <- new('AnnotatedDataFrame', data = [email protected]) fData_atac <- data.frame(gene_short_name = row.names(data_atac), row.names = row.names(data_atac)) fd_atac <- new('AnnotatedDataFrame', data = fData_atac) data_atac <- data_atac[, rownames(pd_atac)]
atac_cicero_monocle2_cds_peaks <- newCellDataSet(data_atac, phenoData = pd_atac, featureData = fd_atac, lowerDetectionLimit = 0.5, expressionFamily = negbinomial.size())
atac_cicero_monocle2_cds_peaks <- estimateSizeFactors(atac_cicero_monocle2_cds_peaks)
all.markers_ATAC_top50<- all.markers %>% group_by(cluster) %>% top_n(n = 50, wt = avg_log2FC)
atac_cicero_monocle2_cds_peaks <- setOrderingFilter(atac_cicero_monocle2_cds_peaks, all.markers_ATAC_top50$gene) atac_cicero_monocle2_cds_peaks <- reduceDimension(atac_cicero_monocle2_cds_peaks, max_components = 2, method = 'DDRTree', ncenter = 100) atac_cicero_monocle2_cds_peaks <- orderCells(atac_cicero_monocle2_cds_peaks)
I get the following error message from ordercells():
Warning: Argument neimode' is deprecated; use
mode' insteadError in if (class(projection) != "matrix") projection <- as.matrix(projection) :
the condition has length > 1
If you could help I would really appreciate it.
Thanks Chris
I have solved this. I recently updated to R4.2 from 4.1. This error only occurs on 4.2. When I switch back to 4.1 I can run this script no problem.
Thanks Chris
I come across the same problem. I wonder if there is a solution for R 4.2.
Hello, I have fixed this problem under R4.2. Here is the solution:
trace('project2MST', edit = T, where = asNamespace("monocle"))
and find the code:
if (class(projection) != "matrix")
projection <- as.matrix(projection) :
delete the if condition line.
Then ordercell function will be work
Thanks for your response! I have tried the solution you mentioned and it works! @yuanlizhanshi