MarioniLab / scran

Clone of the Bioconductor repository for the scran package.
https://bioconductor.org/packages/devel/bioc/html/scran.html
40 stars 22 forks source link

Error encountered when using convertTo() function to convert SingleCellExperiment object to monocle's CellDataSet object #61

Closed ntran95 closed 4 years ago

ntran95 commented 4 years ago

Hello developers,

I'm encountering an error when trying to convert my SingleCellExperiment object to a CellDataSet object from the Monocle3 package.

My code and error is as follows: > test_convert <- scran::convertTo(sce_obj, type="monocle")

Error in loadNamespace(name) : there is no package called ‘monocle’

Here's my version of the Monocle3 package: > packageVersion("monocle3")

[1] ‘0.2.2’

Here's my sessionInfo:

sessionInfo() R version 3.6.3 (2020-02-29) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/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] stats4 parallel stats graphics grDevices utils datasets [8] methods base

other attached packages: [1] gridExtra_2.3 wesanderson_0.3.6
[3] RColorBrewer_1.1-2 ggplot2_3.3.2
[5] CellTrails_1.4.0 Seurat_3.1.5
[7] devtools_2.3.0 usethis_1.6.1
[9] monocle3_0.2.2 SingleCellExperiment_1.8.0 [11] SummarizedExperiment_1.16.1 DelayedArray_0.12.3
[13] BiocParallel_1.20.1 matrixStats_0.56.0
[15] GenomicRanges_1.38.0 GenomeInfoDb_1.22.1
[17] IRanges_2.20.2 S4Vectors_0.24.4
[19] Biobase_2.46.0 BiocGenerics_0.32.0

loaded via a namespace (and not attached): [1] ModelMetrics_1.2.2.2 coda_0.19-3 tidyr_1.1.0
[4] bit64_0.9-7 knitr_1.29 acepack_1.4.1
[7] irlba_2.3.3 dygraphs_1.1.1.6 data.table_1.12.8
[10] rpart_4.1-15 inline_0.3.15 RCurl_1.98-1.2
[13] generics_0.0.2 callr_3.4.3 leidenbase_0.1.0
[16] cowplot_1.0.0 RSQLite_2.2.0 RANN_2.6.1
[19] proxy_0.4-24 future_1.17.0 bit_1.1-15.2
[22] lubridate_1.7.9 httpuv_1.5.4 StanHeaders_2.21.0-5
[25] assertthat_0.2.1 viridis_0.5.1 xfun_0.15
[28] gower_0.2.2 bayesplot_1.7.2 promises_1.1.1
[31] fansi_0.4.1 dendextend_1.13.4 geneplotter_1.64.0
[34] igraph_1.2.5 DBI_1.1.0 htmlwidgets_1.5.1
[37] spdep_1.1-5 purrr_0.3.4 ellipsis_0.3.1
[40] RSpectra_0.16-0 crosstalk_1.1.0.1 dplyr_1.0.0
[43] backports_1.1.8 markdown_1.1 annotate_1.64.0
[46] RcppParallel_5.0.2 deldir_0.1-25 vctrs_0.3.1
[49] remotes_2.1.1 ROCR_1.0-11 caret_6.0-86
[52] withr_2.2.0 checkmate_2.0.0 sctransform_0.2.1
[55] xts_0.12-0 prettyunits_1.1.1 scran_1.14.6
[58] cluster_2.1.0 ape_5.4 lazyeval_0.2.2
[61] crayon_1.3.4 genefilter_1.68.0 edgeR_3.28.1
[64] recipes_0.1.13 pkgconfig_2.0.3 units_0.6-7
[67] nlme_3.1-148 vipor_0.4.5 pkgload_1.1.0
[70] nnet_7.3-14 rlang_0.4.6 globals_0.12.5
[73] lifecycle_0.2.0 miniUI_0.1.1.1 colourpicker_1.0
[76] rsvd_1.0.3 rprojroot_1.3-2 lmtest_0.9-37
[79] Matrix_1.2-18 loo_2.3.0 raster_3.3-7
[82] boot_1.3-25 zoo_1.8-8 base64enc_0.1-3
[85] beeswarm_0.2.3 ggridges_0.5.2 processx_3.4.3
[88] png_0.1-7 viridisLite_0.3.0 bitops_1.0-6
[91] KernSmooth_2.23-17 pROC_1.16.2 blob_1.2.1
[94] DelayedMatrixStats_1.8.0 classInt_0.4-3 stringr_1.4.0
[97] jpeg_0.1-8.1 shinystan_2.5.0 scales_1.1.1
[100] memoise_1.1.0 magrittr_1.5 plyr_1.8.6
[103] ica_1.0-2 gdata_2.18.0 zlibbioc_1.32.0
[106] threejs_0.3.3 compiler_3.6.3 dqrng_0.2.1
[109] rstantools_2.1.1 lme4_1.1-23 DESeq2_1.26.0
[112] fitdistrplus_1.1-1 cli_2.0.2 dtw_1.21-3
[115] XVector_0.26.0 LearnBayes_2.15.1 listenv_0.8.0
[118] patchwork_1.0.1 pbapply_1.4-2 ps_1.3.3
[121] htmlTable_2.0.1 Formula_1.2-3 MASS_7.3-51.6
[124] mgcv_1.8-31 tidyselect_1.1.0 stringi_1.4.6
[127] locfit_1.5-9.4 BiocSingular_1.2.2 latticeExtra_0.6-29
[130] ggrepel_0.8.2 pbmcapply_1.5.0 grid_3.6.3
[133] maptree_1.4-7 tools_3.6.3 future.apply_1.6.0
[136] rstudioapi_0.11 foreign_0.8-75 foreach_1.5.0
[139] prodlim_2019.11.13 EnvStats_2.3.1 Rtsne_0.15
[142] digest_0.6.25 BiocManager_1.30.10 shiny_1.5.0
[145] lava_1.6.7 cba_0.2-21 Rcpp_1.0.5
[148] later_1.1.0.1 RcppAnnoy_0.0.16 AnnotationDbi_1.48.0
[151] httr_1.4.1 rsconnect_0.8.16 sf_0.9-4
[154] colorspace_1.4-1 XML_3.99-0.3 fs_1.4.2
[157] reticulate_1.16 splines_3.6.3 uwot_0.1.8
[160] statmod_1.4.34 expm_0.999-4 scater_1.14.6
[163] sp_1.4-2 shinythemes_1.1.2 plotly_4.9.2.1
[166] sessioninfo_1.1.1 spData_0.3.8 xtable_1.8-4
[169] rstanarm_2.19.3 jsonlite_1.7.0 nloptr_1.2.2.2
[172] timeDate_3043.102 rstan_2.19.3 testthat_2.3.2
[175] ipred_0.9-9 R6_2.4.1 Hmisc_4.4-0
[178] gmodels_2.18.1 pillar_1.4.4 htmltools_0.5.0
[181] mime_0.9 glue_1.4.1 fastmap_1.0.1
[184] minqa_1.2.4 DT_0.14 BiocNeighbors_1.4.2
[187] class_7.3-17 codetools_0.2-16 pkgbuild_1.0.8
[190] tsne_0.1-3 lattice_0.20-41 tibble_3.0.2
[193] ggbeeswarm_0.6.0 leiden_0.3.3 gtools_3.8.2
[196] shinyjs_1.1 survival_3.2-3 limma_3.42.2
[199] desc_1.2.0 munsell_0.5.0 e1071_1.7-3
[202] GenomeInfoDbData_1.2.2 iterators_1.0.12 reshape2_1.4.4
[205] gtable_0.3.0

Any insights is greatly appreciated!

LTLA commented 4 years ago

tl;dr the convertTo() function converts to Monocle 2's CellDataSet.

Monocle 3 isn't on Bioconductor yet so I can't convert to something that doesn't exist outside of a production environment. Fortunately, Monocle 3's data structure is based on the SingleCellExperiment, so the coercion may actually be as easy as doing something like:

as(sce, "cell_data_set")

Of course, this assumes that they defined an appropriate setAs method to do this. Pinging @hpliner.

ntran95 commented 4 years ago

Perfect, thank you for the alternative method.

as(sce, "cell_data_set") did the trick. Closing issue now, thanks!