monocle-release
monocle-release copied to clipboard
R Kept crash during OrderCell
Hi, I tried to do "Analyzing Branches in Single-Cell Trajectories" using monocle and always get crashed when doing orderCells. I also get the repeated warnings during the process
"[Output truncated]Warning in if (class(projection) != "matrix") projection <- as.matrix(projection) : the condition has length > 1 and only the first element will be used"
Below are the scripts. Do I need to try Monocle3 instead or anything wrong with my code to cause the crash? Thanks!
pre <- as(as.matrix(PA.combined.pre.2@assays$RNA@data), 'sparseMatrix') pd.pre <- new('AnnotatedDataFrame', data = [email protected]) fData.pre <- data.frame(gene_short_name = row.names(pre), row.names = row.names(pre)) fd.pre <- new('AnnotatedDataFrame', data = fData.pre) pre_monocle <- newCellDataSet(pre, phenoData = pd.pre, featureData = fd.pre, expressionFamily = negbinomial.size()) pre_monocle <- estimateSizeFactors(pre_monocle) pre_monocle <- estimateDispersions(pre_monocle) save(pre_monocle, file = "pre_monocle.RData") pre_monocle <- detectGenes(pre_monocle, min_expr = 0.1) print(head(fData(pre_monocle))) expressed_genes <- row.names(subset(fData(pre_monocle), num_cells_expressed >= 10)) diff_test_res.pre <- differentialGeneTest(pre_monocle[expressed_genes,], fullModelFormulaStr = "~integrated_snn_res.0.1", cores = 8) ordering_genes <- row.names (subset(diff_test_res.pre, qval < 0.01)) pre_monocle <- setOrderingFilter(pre_monocle, ordering_genes) plot_ordering_genes(pre_monocle) pre_monocle <- reduceDimension(pre_monocle, max_components = 2, method = 'DDRTree', cores = 16) pre_monocle <- orderCells(pre_monocle, reverse = FALSE)
sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.2
Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel splines stats4 stats graphics grDevices utils datasets methods
[10] base
other attached packages:
[1] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4
[5] readr_2.1.1 tidyr_1.1.4 tibble_3.1.6 tidyverse_1.3.1
[9] monocle_2.22.0 DDRTree_0.1.5 irlba_2.3.5 VGAM_1.1-5
[13] Biobase_2.54.0 BiocGenerics_0.40.0 Matrix_1.4-0 SeuratWrappers_0.3.0
[17] readxl_1.3.1 SoupX_1.5.2 cowplot_1.1.1 DoubletFinder_2.0.3
[21] ggplot2_3.3.5 patchwork_1.1.1 SeuratObject_4.0.4 Seurat_4.1.0
loaded via a namespace (and not attached):
[1] backports_1.4.1 plyr_1.8.6 igraph_1.2.11 lazyeval_0.2.2
[5] densityClust_0.3 listenv_0.8.0 scattermore_0.7 fastICA_1.2-3
[9] digest_0.6.29 htmltools_0.5.2 viridis_0.6.2 fansi_1.0.2
[13] magrittr_2.0.2 tensor_1.5 cluster_2.1.2 ROCR_1.0-11
[17] tzdb_0.2.0 limma_3.50.0 remotes_2.4.2 globals_0.14.0
[21] modelr_0.1.8 matrixStats_0.61.0 R.utils_2.11.0 docopt_0.7.1
[25] spatstat.sparse_2.1-0 colorspace_2.0-2 rvest_1.0.2 ggrepel_0.9.1
[29] haven_2.4.3 xfun_0.29 sparsesvd_0.2 crayon_1.4.2
[33] jsonlite_1.7.3 spatstat.data_2.1-2 survival_3.2-13 zoo_1.8-9
[37] glue_1.6.1 polyclip_1.10-0 gtable_0.3.0 leiden_0.3.9
[41] future.apply_1.8.1 abind_1.4-5 scales_1.1.1 pheatmap_1.0.12
[45] DBI_1.1.2 miniUI_0.1.1.1 Rcpp_1.0.8 viridisLite_0.4.0
[49] xtable_1.8-4 reticulate_1.24 spatstat.core_2.3-2 rsvd_1.0.5
[53] htmlwidgets_1.5.4 httr_1.4.2 FNN_1.1.3 RColorBrewer_1.1-2
[57] ellipsis_0.3.2 ica_1.0-2 pkgconfig_2.0.3 R.methodsS3_1.8.1
[61] dbplyr_2.1.1 uwot_0.1.11 deldir_1.0-6 utf8_1.2.2
[65] tidyselect_1.1.1 rlang_1.0.0 reshape2_1.4.4 later_1.3.0
[69] munsell_0.5.0 cellranger_1.1.0 tools_4.1.2 cli_3.1.1
[73] generics_0.1.1 broom_0.7.11 ggridges_0.5.3 evaluate_0.14
[77] fastmap_1.1.0 yaml_2.2.2 goftest_1.2-3 fs_1.5.2
[81] knitr_1.37 fitdistrplus_1.1-6 RANN_2.6.1 pbapply_1.5-0
[85] future_1.23.0 nlme_3.1-155 mime_0.12 slam_0.1-50
[89] R.oo_1.24.0 xml2_1.3.3 rstudioapi_0.13 compiler_4.1.2
[93] plotly_4.10.0 png_0.1-7 spatstat.utils_2.3-0 reprex_2.0.1
[97] stringi_1.7.6 lattice_0.20-45 HSMMSingleCell_1.14.0 vctrs_0.3.8
[101] pillar_1.6.5 lifecycle_1.0.1 BiocManager_1.30.16 spatstat.geom_2.3-1
[105] combinat_0.0-8 lmtest_0.9-39 RcppAnnoy_0.0.19 data.table_1.14.2
[109] httpuv_1.6.5 R6_2.5.1 promises_1.2.0.1 KernSmooth_2.23-20
[113] gridExtra_2.3 parallelly_1.30.0 codetools_0.2-18 MASS_7.3-55
[117] assertthat_0.2.1 withr_2.4.3 qlcMatrix_0.9.7 sctransform_0.3.3
[121] hms_1.1.1 mgcv_1.8-38 grid_4.1.2 rpart_4.1.16
[125] rmarkdown_2.11 Rtsne_0.15 lubridate_1.8.0 shiny_1.7.1
I met the same problem, any solution? Thanks! I tried reinstall the monocle package, but it didn't work.