Conversion to SingleCellExperiment from Seurat objects
0
0
Entering edit mode
@wolfgang-huber-3550
Last seen 3 months ago
EMBL European Molecular Biology Laborat…

I realize this is slightly out of scope since Seurat 2.3 is on CRAN, not Bioconductor, but given its developers recent interactions with the SIngleCellExperiment developers, I hope it's OK to post this here:

 

When trying to convert one of the Seurat data objects from the tabula muris, I get the following error. This seems to be related to the fact that the raw.data slot in this particular object is stored as a data.frame (rather than, say, matrix or dgCMatrix), which confuses the SummarizedExperiment constructor. A workaround is to convert the slot to a regular matrix before the conversion (see below). Perhaps it'd be a good idea to add that kind of workaround to the Seurat::as.SingleCellExperiment.seurat function (an alternative would be to clean the internet from legacy Seurat objects, which is perhaps less realistic?)

library("Seurat")

# from https://figshare.com/articles/Robject_files_for_tissues_processed_by_Seurat/5821263
load("facs_Liver_seurat_tiss.Robj")
tiss2 = tiss
tiss2@raw.data = as.matrix(tiss2@raw.data)

sc2 = as.SingleCellExperiment(tiss2)
sc  = as.SingleCellExperiment(tiss)

#Error in seq_len(ncol(assay)) :
#  argument must be coercible to non-negative integer
#In addition: Warning message:
#In seq_len(ncol(assay)) : first element used of 'length.out' argument

> devtools::session_info()
Session info ------------------------------------------------------------------
 setting  value
 version  R Under development (unstable) (2018-05-18 r74745)
 system   x86_64, darwin17.5.0
 ui       unknown
 language (EN)
 collate  en_US.UTF-8
 tz       Europe/Berlin
 date     2018-05-21

Packages ----------------------------------------------------------------------
 package              * version    date       source
 abind                  1.4-5      2016-07-21 CRAN (R 3.6.0)
 acepack                1.4.1      2016-10-29 CRAN (R 3.6.0)
 ape                    5.1        2018-04-04 CRAN (R 3.6.0)
 assertthat             0.2.0      2017-04-11 CRAN (R 3.6.0)
 backports              1.1.2      2017-12-13 CRAN (R 3.6.0)
 base                 * 3.6.0      2018-05-19 local
 base64enc              0.1-3      2015-07-28 CRAN (R 3.6.0)
 bindr                  0.1.1      2018-03-13 CRAN (R 3.6.0)
 bindrcpp               0.2.2      2018-03-29 CRAN (R 3.6.0)
 Biobase                2.41.0     2018-05-21 Bioconductor
 BiocGenerics           0.27.0     2018-05-21 Bioconductor
 BiocParallel           1.15.3     2018-05-21 Bioconductor
 bitops                 1.0-6      2013-08-17 CRAN (R 3.6.0)
 broom                  0.4.4      2018-03-29 CRAN (R 3.6.0)
 caret                  6.0-79     2018-03-29 CRAN (R 3.6.0)
 caTools                1.17.1     2014-09-10 CRAN (R 3.6.0)
 checkmate              1.8.5      2017-10-24 CRAN (R 3.6.0)
 class                  7.3-14     2015-08-30 CRAN (R 3.6.0)
 cluster                2.0.7-1    2018-04-13 CRAN (R 3.6.0)
 codetools              0.2-15     2016-10-05 CRAN (R 3.6.0)
 colorspace             1.3-2      2016-12-14 CRAN (R 3.6.0)
 compiler               3.6.0      2018-05-19 local
 cowplot              * 0.9.2      2017-12-17 CRAN (R 3.6.0)
 CVST                   0.2-1      2013-12-10 CRAN (R 3.6.0)
 data.table             1.11.2     2018-05-08 CRAN (R 3.6.0)
 datasets             * 3.6.0      2018-05-19 local
 ddalpha                1.3.3      2018-04-30 CRAN (R 3.6.0)
 DelayedArray           0.7.0      2018-05-21 Bioconductor
 DEoptimR               1.0-8      2016-11-19 CRAN (R 3.6.0)
 devtools               1.13.5     2018-02-18 CRAN (R 3.6.0)
 diffusionMap           1.1-0      2014-02-20 CRAN (R 3.6.0)
 digest                 0.6.15     2018-01-28 CRAN (R 3.6.0)
 dimRed                 0.1.0      2017-05-04 CRAN (R 3.6.0)
 diptest                0.75-7     2016-12-05 CRAN (R 3.6.0)
 doSNOW                 1.0.16     2017-12-13 CRAN (R 3.6.0)
 dplyr                  0.7.5      2018-05-19 CRAN (R 3.6.0)
 DRR                    0.0.3      2018-01-06 CRAN (R 3.6.0)
 dtw                    1.20-1     2018-05-18 CRAN (R 3.6.0)
 fitdistrplus           1.0-9      2017-03-24 CRAN (R 3.6.0)
 flexmix                2.3-14     2017-04-28 CRAN (R 3.6.0)
 FNN                    1.1        2013-07-31 CRAN (R 3.6.0)
 foreach                1.4.4      2017-12-12 CRAN (R 3.6.0)
 foreign                0.8-70     2017-11-28 CRAN (R 3.6.0)
 Formula                1.2-3      2018-05-03 CRAN (R 3.6.0)
 fortunes             * 1.5-4      2016-12-29 CRAN (R 3.6.0)
 fpc                    2.1-11     2018-01-13 CRAN (R 3.6.0)
 gdata                  2.18.0     2017-06-06 CRAN (R 3.6.0)
 GenomeInfoDb           1.17.1     2018-05-21 Bioconductor
 GenomeInfoDbData       1.1.0      2018-05-19 Bioconductor
 GenomicRanges          1.33.5     2018-05-21 Bioconductor
 geometry               0.3-6      2015-09-09 CRAN (R 3.6.0)
 ggplot2              * 2.2.1      2016-12-30 CRAN (R 3.6.0)
 ggridges               0.5.0      2018-04-05 CRAN (R 3.6.0)
 glue                   1.2.0      2017-10-29 CRAN (R 3.6.0)
 gower                  0.1.2      2017-02-23 CRAN (R 3.6.0)
 gplots                 3.0.1      2016-03-30 CRAN (R 3.6.0)
 graphics             * 3.6.0      2018-05-19 local
 grDevices            * 3.6.0      2018-05-19 local
 grid                   3.6.0      2018-05-19 local
 gridExtra              2.3        2017-09-09 CRAN (R 3.6.0)
 gtable                 0.2.0      2016-02-26 CRAN (R 3.6.0)
 gtools                 3.5.0      2015-05-29 CRAN (R 3.6.0)
 Hmisc                  4.1-1      2018-01-03 CRAN (R 3.6.0)
 htmlTable              1.11.2     2018-01-20 CRAN (R 3.6.0)
 htmltools              0.3.6      2017-04-28 CRAN (R 3.6.0)
 htmlwidgets            1.2        2018-04-19 CRAN (R 3.6.0)
 ica                    1.0-1      2015-08-25 CRAN (R 3.6.0)
 igraph                 1.2.1      2018-03-10 CRAN (R 3.6.0)
 ipred                  0.9-6      2017-03-01 CRAN (R 3.6.0)
 IRanges                2.15.13    2018-05-21 Bioconductor
 irlba                  2.3.2      2018-01-11 CRAN (R 3.6.0)
 iterators              1.0.9      2017-12-12 CRAN (R 3.6.0)
 jsonlite               1.5        2017-06-01 CRAN (R 3.6.0)
 kernlab                0.9-26     2018-04-30 CRAN (R 3.6.0)
 KernSmooth             2.23-15    2015-06-29 CRAN (R 3.6.0)
 knitr                  1.20       2018-02-20 CRAN (R 3.6.0)
 lars                   1.2        2013-04-24 CRAN (R 3.6.0)
 lattice                0.20-35    2017-03-25 CRAN (R 3.6.0)
 latticeExtra           0.6-28     2016-02-09 CRAN (R 3.6.0)
 lava                   1.6.1      2018-03-28 CRAN (R 3.6.0)
 lazyeval               0.2.1      2017-10-29 CRAN (R 3.6.0)
 lmtest                 0.9-36     2018-04-04 CRAN (R 3.6.0)
 lubridate              1.7.4      2018-04-11 CRAN (R 3.6.0)
 magic                  1.5-8      2018-01-26 CRAN (R 3.6.0)
 magrittr               1.5        2014-11-22 CRAN (R 3.6.0)
 MASS                   7.3-50     2018-04-30 CRAN (R 3.6.0)
 Matrix               * 1.2-14     2018-04-13 CRAN (R 3.6.0)
 matrixStats            0.53.1     2018-02-11 CRAN (R 3.6.0)
 mclust                 5.4        2017-11-22 CRAN (R 3.6.0)
 memoise                1.1.0      2017-04-21 CRAN (R 3.6.0)
 metap                  0.9        2018-04-25 CRAN (R 3.6.0)
 methods              * 3.6.0      2018-05-19 local
 mixtools               1.1.0      2017-03-10 CRAN (R 3.6.0)
 mnormt                 1.5-5      2016-10-15 CRAN (R 3.6.0)
 ModelMetrics           1.1.0      2016-08-26 CRAN (R 3.6.0)
 modeltools             0.2-21     2013-09-02 CRAN (R 3.6.0)
 munsell                0.4.3      2016-02-13 CRAN (R 3.6.0)
 mvtnorm                1.0-7      2018-01-26 CRAN (R 3.6.0)
 nlme                   3.1-137    2018-04-07 CRAN (R 3.6.0)
 nnet                   7.3-12     2016-02-02 CRAN (R 3.6.0)
 numDeriv               2016.8-1   2016-08-27 CRAN (R 3.6.0)
 parallel               3.6.0      2018-05-19 local
 pbapply                1.3-4      2018-01-10 CRAN (R 3.6.0)
 pillar                 1.2.2      2018-04-26 CRAN (R 3.6.0)
 pkgconfig              2.0.1      2017-03-21 CRAN (R 3.6.0)
 plyr                   1.8.4      2016-06-08 CRAN (R 3.6.0)
 png                    0.1-7      2013-12-03 CRAN (R 3.6.0)
 prabclus               2.2-6      2015-01-14 CRAN (R 3.6.0)
 prodlim                2018.04.18 2018-04-18 CRAN (R 3.6.0)
 proxy                  0.4-22     2018-04-08 CRAN (R 3.6.0)
 psych                  1.8.4      2018-05-06 CRAN (R 3.6.0)
 purrr                  0.2.4      2017-10-18 CRAN (R 3.6.0)
 R.methodsS3            1.7.1      2016-02-16 CRAN (R 3.6.0)
 R.oo                   1.22.0     2018-04-22 CRAN (R 3.6.0)
 R.utils                2.6.0      2017-11-05 CRAN (R 3.6.0)
 R6                     2.2.2      2017-06-17 CRAN (R 3.6.0)
 ranger                 0.9.0      2018-01-09 CRAN (R 3.6.0)
 RANN                   2.5.1      2017-05-21 CRAN (R 3.6.0)
 RColorBrewer           1.1-2      2014-12-07 CRAN (R 3.6.0)
 Rcpp                   0.12.17    2018-05-18 CRAN (R 3.6.0)
 RcppRoll               0.2.2      2015-04-05 CRAN (R 3.6.0)
 RCurl                  1.95-4.10  2018-01-04 CRAN (R 3.6.0)
 recipes                0.1.2      2018-01-11 CRAN (R 3.6.0)
 reshape2               1.4.3      2017-12-11 CRAN (R 3.6.0)
 reticulate             1.7        2018-04-28 CRAN (R 3.6.0)
 rlang                  0.2.0      2018-02-20 CRAN (R 3.6.0)
 robustbase             0.93-0     2018-04-24 CRAN (R 3.6.0)
 ROCR                   1.0-7      2015-03-26 CRAN (R 3.6.0)
 rpart                  4.1-13     2018-02-23 CRAN (R 3.6.0)
 rstudioapi             0.7        2017-09-07 CRAN (R 3.6.0)
 Rtsne                  0.13       2017-04-14 CRAN (R 3.6.0)
 S4Vectors              0.19.5     2018-05-21 Bioconductor
 scales                 0.5.0      2017-08-24 CRAN (R 3.6.0)
 scatterplot3d          0.3-41     2018-03-14 CRAN (R 3.6.0)
 SDMTools               1.1-221    2014-08-05 CRAN (R 3.6.0)
 segmented              0.5-3.0    2017-11-30 CRAN (R 3.6.0)
 Seurat               * 2.3.1      2018-05-05 CRAN (R 3.6.0)
 sfsmisc                1.1-2      2018-03-05 CRAN (R 3.6.0)
 SingleCellExperiment   1.3.2      2018-05-21 Bioconductor
 sn                     1.5-2      2018-04-24 CRAN (R 3.6.0)
 snow                   0.4-2      2016-10-14 CRAN (R 3.6.0)
 splines                3.6.0      2018-05-19 local
 stats                * 3.6.0      2018-05-19 local
 stats4                 3.6.0      2018-05-19 local
 stringi                1.2.2      2018-05-02 CRAN (R 3.6.0)
 stringr                1.3.1      2018-05-10 CRAN (R 3.6.0)
 SummarizedExperiment   1.11.3     2018-05-21 Bioconductor
 survival               2.42-3.1   2018-04-24 CRAN (R 3.6.0)
 tclust                 1.3-1      2017-08-24 CRAN (R 3.6.0)
 tibble                 1.4.2      2018-01-22 CRAN (R 3.6.0)
 tidyr                  0.8.1      2018-05-18 CRAN (R 3.6.0)
 tidyselect             0.2.4      2018-02-26 CRAN (R 3.6.0)
 timeDate               3043.102   2018-02-21 CRAN (R 3.6.0)
 tools                  3.6.0      2018-05-19 local
 trimcluster            0.1-2      2012-10-29 CRAN (R 3.6.0)
 tsne                   0.1-3      2016-07-15 CRAN (R 3.6.0)
 utils                * 3.6.0      2018-05-19 local
 VGAM                   1.0-5      2018-02-07 CRAN (R 3.6.0)
 withr                  2.1.2      2018-03-15 CRAN (R 3.6.0)
 XVector                0.21.1     2018-05-21 Bioconductor
 zlibbioc               1.27.0     2018-05-21 Bioconductor
 zoo                    1.8-1      2018-01-08 CRAN (R 3.6.0)
Seurat SingleCellExperiment • 5.0k views
ADD COMMENT

Login before adding your answer.

Traffic: 970 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