slingshot: error with plot3d.SlingshotDataSet
1
0
Entering edit mode
manduchi ▴ 10
@manduchi-9940
Last seen 9 months ago
United States

Hello,

I am getting an error when calling plot3d.SlingshotDataSet as indicated in the below code. I'm also including traceback, sessionInfo and valid information are below. Can you advise? Thanks,

Elisabetta

library(tidyverse)
library(Seurat)
library(slingshot)
library(scales)
library(RColorBrewer)
library(rgl)

epi <- readRDS('epi.rds')
epi
## An object of class Seurat 
## 35391 features across 26008 samples within 2 assays 
## Active assay: integrated (4338 features, 4338 variable features)
## 1 other assay present: RNA
## 3 dimensional reductions calculated: pca, umap, tsne

sling3 <- slingshot(Embeddings(epi, "pca")[,1:3], clusterLabels=Idents(epi), start.clus='Stem')
sling3
## class: PseudotimeOrdering 
## dim: 26008 4 
## metadata(4): lineages mst slingParams curves
## pathStats(2): pseudotime weights
## cellnames(26008): A_AAGTGAACACTTTATC A_AAGTGAACAGTGGCTC ... D_TTTGTTGTCGGCATTA
## D_TTTGTTGTCTCAATCT
## cellData names(2): reducedDim clusterLabels
## pathnames(4): Lineage1 Lineage2 Lineage3 Lineage4
## pathData names(0):

plot3d.SlingshotDataSet(sling3, type='l')
## Error in (function (classes, fdef, mtable)  : 
## unable to find an inherited method for function ‘reducedDim’ for signature ‘"PseudotimeOrdering", "missing"’

 traceback()
## 5: stop(gettextf("unable to find an inherited method for function %s for signature %s", 
##        sQuote(fdef@generic), sQuote(cnames)), domain = NA)
## 4: (function (classes, fdef, mtable) 
##   {
##        methods <- .findInheritedMethods(classes, fdef, mtable)
##        if (length(methods) == 1L) 
##           return(methods[[1L]])
##        else if (length(methods) == 0L) {
##            cnames <- paste0("\"", vapply(classes, as.character, 
##                ""), "\"", collapse = ", ")
##            stop(gettextf("unable to find an inherited method for function %s for signature %s", 
##                sQuote(fdef@generic), sQuote(cnames)), domain = NA)
##        }
##        else stop("Internal error in finding inherited methods; didn't return a unique method", 
##            domain = NA)
##    })(list(structure("PseudotimeOrdering", package = "TrajectoryUtils"), 
##        structure("missing", package = "methods")), new("standardGeneric", 
##        .Data = function (x, type, ...) 
##        standardGeneric("reducedDim"), generic = structure("reducedDim", package = "SingleCellExperiment"), 
##        package = "SingleCellExperiment", group = list(), valueClass = character(0), 
##        signature = c("x", "type"), default = NULL, skeleton = (function (x, 
##            type, ...) 
##     ...
## 3: reducedDim(x)
## 2: nrow(reducedDim(x))
## 1: plot3d.SlingshotDataSet(sling3, type = "l")

sessionInfo()
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19044)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] rgl_0.108.3.2               RColorBrewer_1.1-3          scales_1.2.0               
##  [4] slingshot_2.0.0             TrajectoryUtils_1.0.0       SingleCellExperiment_1.14.1
##  [7] SummarizedExperiment_1.22.0 Biobase_2.52.0              GenomicRanges_1.44.0       
## [10] GenomeInfoDb_1.28.4         IRanges_2.26.0              S4Vectors_0.30.2           
## [13] BiocGenerics_0.38.0         MatrixGenerics_1.4.3        matrixStats_0.62.0         
## [16] princurve_2.1.6             sp_1.4-7                    SeuratObject_4.1.0         
## [19] Seurat_4.1.1                forcats_0.5.1               stringr_1.4.0              
## [22] dplyr_1.0.9                 purrr_0.3.4                 readr_2.1.2                
## [25] tidyr_1.2.0                 tibble_3.1.7                ggplot2_3.3.6              
## [28] tidyverse_1.3.1            
## 
## loaded via a namespace (and not attached):
##   [1] readxl_1.4.0           backports_1.4.1        plyr_1.8.7             igraph_1.3.1          
##   [5] lazyeval_0.2.2         splines_4.1.2          listenv_0.8.0          scattermore_0.8       
##   [9] digest_0.6.29          htmltools_0.5.2        fansi_1.0.3            magrittr_2.0.3        
##  [13] tensor_1.5             cluster_2.1.3          ROCR_1.0-11            tzdb_0.3.0            
##  [17] globals_0.15.0         modelr_0.1.8           spatstat.sparse_2.1-1  colorspace_2.0-3      
##  [21] rvest_1.0.2            ggrepel_0.9.1          haven_2.5.0            xfun_0.31             
##  [25] RCurl_1.98-1.6         crayon_1.5.1           jsonlite_1.8.0         progressr_0.10.1      
##  [29] spatstat.data_2.2-0    survival_3.3-1         zoo_1.8-10             glue_1.6.2            
##  [33] polyclip_1.10-0        gtable_0.3.0           zlibbioc_1.38.0        XVector_0.32.0        
##  [37] leiden_0.4.2           DelayedArray_0.18.0    future.apply_1.9.0     abind_1.4-5           
##  [41] DBI_1.1.2              spatstat.random_2.2-0  miniUI_0.1.1.1         Rcpp_1.0.8.3          
##  [45] viridisLite_0.4.0      xtable_1.8-4           reticulate_1.25        spatstat.core_2.4-4   
##  [49] htmlwidgets_1.5.4      httr_1.4.3             ellipsis_0.3.2         ica_1.0-2             
##  [53] pkgconfig_2.0.3        uwot_0.1.11            dbplyr_2.2.0           deldir_1.0-6          
##  [57] utf8_1.2.2             tidyselect_1.1.2       rlang_1.0.2            reshape2_1.4.4        
##  [61] later_1.3.0            munsell_0.5.0          cellranger_1.1.0       tools_4.1.2           
##  [65] cli_3.3.0              generics_0.1.2         broom_0.8.0            ggridges_0.5.3        
##  [69] fastmap_1.1.0          goftest_1.2-3          knitr_1.39             fs_1.5.2              
##  [73] fitdistrplus_1.1-8     RANN_2.6.1             pbapply_1.5-0          future_1.26.1         
##  [77] nlme_3.1-157           mime_0.12              xml2_1.3.3             compiler_4.1.2        
##  [81] rstudioapi_0.13        plotly_4.10.0          png_0.1-7              spatstat.utils_2.3-1  
##  [85] reprex_2.0.1           stringi_1.7.6          rgeos_0.5-9            lattice_0.20-45       
##  [89] Matrix_1.4-1           vctrs_0.4.1            pillar_1.7.0           lifecycle_1.0.1       
##  [93] BiocManager_1.30.18    spatstat.geom_2.4-0    lmtest_0.9-40          RcppAnnoy_0.0.19      
##  [97] bitops_1.0-7           data.table_1.14.2      cowplot_1.1.1          irlba_2.3.5           
## [101] httpuv_1.6.5           patchwork_1.1.1        R6_2.5.1               promises_1.2.0.1      
## [105] KernSmooth_2.23-20     gridExtra_2.3          parallelly_1.32.0      codetools_0.2-18      
## [109] MASS_7.3-57            assertthat_0.2.1       withr_2.5.0            sctransform_0.3.3     
## [113] GenomeInfoDbData_1.2.6 mgcv_1.8-40            hms_1.1.1              grid_4.1.2            
## [117] rpart_4.1.16           Rtsne_0.16             shiny_1.7.1            lubridate_1.8.0

BiocManager::valid()
## 'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
## 
## replacement repositories:
##     CRAN: https://cran.rstudio.com/
## 
##
## * sessionInfo()
##
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19044)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
##
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
##
## loaded via a namespace (and not attached):
## [1] BiocManager_1.30.18 compiler_4.1.2      tools_4.1.2        
##
## Bioconductor version '3.13'
##
##   * 2 packages out-of-date
##   * 0 packages too new
## 
## create a valid installation with
## 
##   BiocManager::install(c(
##    "restfulr", "sp"
##   ), update = TRUE, ask = FALSE)
## 
## more details: BiocManager::valid()$too_new, BiocManager::valid()$out_of_date
## 
## Warning message:
## 2 packages out-of-date; 0 packages too new
slingshot plot3d.SlingshotDataSet • 2.4k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States

Are you missing a SlingshotDataSet step?

ADD COMMENT
0
Entering edit mode

Ahhh, yes that was the problem, thanks! Elisabetta

ADD REPLY
0
Entering edit mode

Hi please i am encountering similar issue how did you fix it. Here is the code:

Run Slingshot

p3.neuron.sds <- slingshot(Embeddings(object=p3.moe.neuron.integrated, "pca")[,1:50], clusterLabels = p3.moe.neuron.integrated@active.ident, start.clus = "GBC", end.clus = "mOSN", stretch = 0)

And i am trying to plot the result

svglite(filename = paste0(paper_images,"p3.slingshot.centroids.cell_type.svg"),width=10,height=10) plot(reducedDim(p3.neuron.sds),col=p3.neuron.celltype.col,pch=16,cex=0.5) lines(p3.neuron.sds,lwd=2,type='lineages',col='black') legend("topright",legend=levels(p3.moe.neuron.integrated@active.ident), col=p3.moe.neuron.colors.cell_type,pch=16,bty='n') invisible(dev.off())

i keep getting this error message

ADD REPLY
0
Entering edit mode

This issue has been addressed on GitHub.

ADD REPLY

Login before adding your answer.

Traffic: 499 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6