monocle3 icon indicating copy to clipboard operation
monocle3 copied to clipboard

plot_genes_in_pseudotime gives expressionFamily error

Open hilalga opened this issue 4 years ago • 4 comments

Hi,

I have imported a dataset I have analysed in Seurat into Monocle3 using the SeuratWrappers function as.cell_data_set and continued on to the pseudotime analysis in Monocle3 which worked well.

However, when I try to check how my genes of interest develop over pseudotime using the function plot_genes_in_pseudotime, I get an error about a missing slot. I have used the function previously with similiar objects without any issue. And I can also not find the slot cds_subset@expressionFamily in objects where I didn't get an error and the plotting went well.

What could be the reason for this error?

This is the code I used and the error message:

> genes_of_interest <- c("Trem2")
> GOI_mono <- mouse_Mono[rowData(mouse_Mono)$gene_short_name %in% genes_of_interest, colData(mouse_Mono)$seurat_clusters %in% c("1", "2")]
> plot_genes_in_pseudotime(GOI_mono)

Error in cds_subset@expressionFamily@vfamily %in% c("negbinomial", "negbinomial.size") : no slot of name "expressionFamily" for this object of class "cell_data_set"

Here the traceback:

> traceback()

2: cds_subset@expressionFamily@vfamily %in% c("negbinomial", "negbinomial.size") 1: plot_genes_in_pseudotime(GOI_mono)

sessionInfo:

R version 4.0.3 (2020-10-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.5 LTS

Matrix products: default BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] splines stats4 parallel stats graphics grDevices utils datasets [9] methods base

other attached packages: [1] SeuratData_0.2.1 monocle_2.16.0
[3] DDRTree_0.1.5 irlba_2.3.3
[5] VGAM_1.1-4 Matrix_1.2-18
[7] monocle3_0.2.3.0 SingleCellExperiment_1.10.1 [9] SummarizedExperiment_1.18.2 DelayedArray_0.14.1
[11] matrixStats_0.57.0 GenomicRanges_1.40.0
[13] GenomeInfoDb_1.24.2 IRanges_2.22.2
[15] S4Vectors_0.26.1 metap_1.4
[17] plotly_4.9.2.1 gtools_3.8.2
[19] stringr_1.4.0 svglite_1.2.3.2
[21] ggplot2_3.3.2 multtest_2.44.0
[23] Biobase_2.48.0 BiocGenerics_0.34.0
[25] BiocManager_1.30.10 patchwork_1.0.1
[27] SeuratWrappers_0.3.0 Seurat_3.2.2
[29] dplyr_1.0.2 RhpcBLASctl_0.20-137

loaded via a namespace (and not attached): [1] reticulate_1.18 tidyselect_1.1.0 htmlwidgets_1.5.2
[4] grid_4.0.3 combinat_0.0-8 docopt_0.7.1
[7] Rtsne_0.15 munsell_0.5.0 codetools_0.2-16
[10] mutoss_0.1-12 ica_1.0-2 future_1.19.1
[13] miniUI_0.1.1.1 withr_2.3.0 colorspace_1.4-1
[16] fastICA_1.2-2 rstudioapi_0.11 ROCR_1.0-11
[19] tensor_1.5 gbRd_0.4-11 listenv_0.8.0
[22] Rdpack_2.0 labeling_0.4.2 slam_0.1-47
[25] GenomeInfoDbData_1.2.3 mnormt_2.0.2 polyclip_1.10-0
[28] farver_2.0.3 pheatmap_1.0.12 vctrs_0.3.4
[31] generics_0.1.0 TH.data_1.0-10 R6_2.5.0
[34] rsvd_1.0.3 bitops_1.0-6 spatstat.utils_1.17-0 [37] assertthat_0.2.1 promises_1.1.1 scales_1.1.1
[40] multcomp_1.4-14 gtable_0.3.0 globals_0.13.1
[43] goftest_1.2-2 sandwich_3.0-0 rlang_0.4.8
[46] systemfonts_0.3.2 lazyeval_0.2.2 reshape2_1.4.4
[49] abind_1.4-5 httpuv_1.5.4 tools_4.0.3
[52] ellipsis_0.3.1 RColorBrewer_1.1-2 proxy_0.4-24
[55] ggridges_0.5.2 TFisher_0.2.0 Rcpp_1.0.5
[58] plyr_1.8.6 zlibbioc_1.34.0 purrr_0.3.4
[61] RCurl_1.98-1.2 densityClust_0.3 rpart_4.1-15
[64] deldir_0.1-29 pbapply_1.4-3 viridis_0.5.1
[67] cowplot_1.1.0 zoo_1.8-8 ggrepel_0.8.2
[70] cluster_2.1.0 magrittr_1.5 data.table_1.13.2
[73] lmtest_0.9-38 RANN_2.6.1 tmvnsim_1.0-2
[76] mvtnorm_1.1-1 fitdistrplus_1.1-1 mime_0.9
[79] xtable_1.8-4 sparsesvd_0.2 gridExtra_2.3
[82] HSMMSingleCell_1.8.0 compiler_4.0.3 tibble_3.0.4
[85] KernSmooth_2.23-17 crayon_1.3.4 htmltools_0.5.0
[88] mgcv_1.8-33 later_1.1.0.1 tidyr_1.1.2
[91] rappdirs_0.3.1 MASS_7.3-53 leidenbase_0.1.2
[94] cli_2.1.0 rbibutils_1.3 igraph_1.2.6
[97] pkgconfig_2.0.3 sn_1.6-2 numDeriv_2016.8-1.1
[100] xml2_1.3.2 XVector_0.28.0 digest_0.6.27
[103] sctransform_0.3.1 RcppAnnoy_0.0.16 spatstat.data_1.4-3
[106] leiden_0.3.4 uwot_0.1.8 gdtools_0.2.2
[109] shiny_1.5.0 lifecycle_0.2.0 nlme_3.1-149
[112] jsonlite_1.7.1 viridisLite_0.3.0 limma_3.44.3
[115] fansi_0.4.1 pillar_1.4.6 lattice_0.20-41
[118] fastmap_1.0.1 httr_1.4.2 plotrix_3.7-8
[121] survival_3.2-7 glue_1.4.2 remotes_2.2.0
[124] qlcMatrix_0.9.7 FNN_1.1.3 spatstat_1.64-1
[127] png_0.1-7 stringi_1.5.3 mathjaxr_1.0-1
[130] future.apply_1.6.0

hilalga avatar Nov 16 '20 12:11 hilalga

Hello! I am having this same issue. Did you figure out a solution?

brookeabrown avatar Sep 09 '22 15:09 brookeabrown

Hi, I got it working by reinstalling the developmental version of monocle 3 with all the dependency packages and all suggested updates when installing. Not sure what installation or update solved it in the end, but this solution approach worked for me. So e.g. this kind of R code line produced an image then: plot_genes_in_pseudotime(AFD_lineage_cds2, color_cells_by="pseudotime", min_expr=0.1,label_by_short_name=FALSE)

paulitikka avatar Nov 08 '22 13:11 paulitikka

Hi, Could you help me to resolve this problem? please genes_of_interest <- c("Mtor") cds_1 <- cds_SHGres01_2[rowData(cds_SHGres01_2)$gene_short_name %in% genes_of_interest, colData(cds_SHGres01_2)$orig.ident %in% c("1", "2")] plot_genes_in_pseudotime(cds_1)

Error in $<-.data.frame(*tmp*, "Size_Factor", value = 1) : replacement has 1 row, data has 0

traceback() 4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), N, nrows), domain = NA) 3: $<-.data.frame(*tmp*, "Size_Factor", value = 1) 2: $<-(*tmp*, "Size_Factor", value = 1) 1: plot_genes_in_pseudotime(cds_1)

I reinstalled the developmental version, but it didn't work.

ZayaAyush avatar Dec 01 '22 21:12 ZayaAyush

Hi,

I reinstalled the development version, still didn't work. Wonder if either of you were able to fix it?

Thanks!

apal6 avatar Aug 10 '23 19:08 apal6