Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cell_data_set validity checks are failing on Bioconductor 3.10 #246

Closed
mjsteinbaugh opened this issue Oct 31, 2019 · 11 comments
Closed

cell_data_set validity checks are failing on Bioconductor 3.10 #246

mjsteinbaugh opened this issue Oct 31, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@mjsteinbaugh
Copy link
Contributor

Hi @hpliner,

You may be aware of this already, but I'm seeing some issues with validity checks on cell_data_set using Bioconductor 3.10, due to changes in SingleCellExperiment.

Here's an example, following your recommended example dataset on the monocle3 website

cds <- new_cell_data_set(
     expression_data = expression_data,
     ## cell_metadata = cell_metadata,
     gene_metadata = gene_metadata
)
Error in checkSlotAssignment(object, name, value) : 
  'reducedDims' is not a slot in class "SingleCellExperiment"
Calls: new_cell_data_set ... .valid.Vector.length -> as -> asMethod -> slot<- -> checkSlotAssignment
Backtrace:
     █
  1. └─monocle3::new_cell_data_set(...)
  2.   └─methods::new(...)
  3.     ├─methods::initialize(value, ...)
  4.     └─methods::initialize(value, ...)
  5.       └─methods::validObject(.Object)
  6.         ├─methods:::anyStrings(validityMethod(as(object, superClass)))
  7.         │ └─base::isTRUE(x)
  8.         ├─S4Vectors:::validityMethod(as(object, superClass))
  9.         │ └─S4Vectors:::method(object)
 10.         │   └─S4Vectors:::.valid.Vector.length(x)
 11.         └─methods::as(object, superClass)
 12.           └─methods:::asMethod(object)
 13.             └─methods::`slot<-`(...)
 14.               └─methods::checkSlotAssignment(object, name, value)

Previously saved objects are currently failing validObject() checks, due to the underlying changes in SingleCellExperiment.

Best,
Mike

@mjsteinbaugh mjsteinbaugh added the bug Something isn't working label Oct 31, 2019
@hpliner
Copy link
Collaborator

hpliner commented Nov 1, 2019

Hi Mike,
Thanks for the report. Would you mind submitting your sessionInfo for the example that fails? I'm having trouble reproducing it with Bioconductor 3.10 (SingleCellExperiment 1.8.0)

@mjsteinbaugh
Copy link
Contributor Author

Sure I’ll work on a reprex this weekend and get back to you

@mjsteinbaugh
Copy link
Contributor Author

mjsteinbaugh commented Nov 6, 2019

Hi @hpliner, I can confirm that I'm still seeing this issue on multiple machines, both Linux and macOS.

Here's the code I'm testing:
https://github.com/acidgenomics/acidtest/blob/master/data-raw/cell_data_set.R

I'm running the latest version of Bioconductor 3.10, with BiocManager::valid() returning TRUE.

Here's the stack trace:

Error in checkSlotAssignment(object, name, value) : 
  'reducedDims' is not a slot in class "SingleCellExperiment"
Calls: new_cell_data_set ... .valid.Vector.length -> as -> asMethod -> slot<- -> checkSlotAssignment
Backtrace:
     █
  1. └─monocle3::new_cell_data_set(...)
  2.   └─methods::new(...)
  3.     ├─methods::initialize(value, ...)
  4.     └─methods::initialize(value, ...)
  5.       └─methods::validObject(.Object)
  6.         ├─methods:::anyStrings(validityMethod(as(object, superClass)))
  7.         │ └─base::isTRUE(x)
  8.         ├─S4Vectors:::validityMethod(as(object, superClass))
  9.         │ └─S4Vectors:::method(object)
 10.         │   └─S4Vectors:::.valid.Vector.length(x)
 11.         └─methods::as(object, superClass)
 12.           └─methods:::asMethod(object)
 13.             └─methods::`slot<-`(...)
 14.               └─methods::checkSlotAssignment(object, name, value)

Session info via sessioninfo::session_info():

> sessioninfo::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.1 (2019-07-05)
 os       Red Hat Enterprise Linux    
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2019-11-06                  

─ Packages ────────────────────────────────────────────────────────────────────────────────────
 package                * version   date       lib source                                     
 acidbase                 0.1.1     2019-10-23 [1] Github (acidgenomics/acidbase@0116b98)     
 AnnotationDbi            1.48.0    2019-10-29 [1] Bioconductor                               
 AnnotationFilter         1.10.0    2019-10-29 [1] Bioconductor                               
 AnnotationHub            2.18.0    2019-10-29 [1] Bioconductor                               
 askpass                  1.1       2019-01-13 [1] CRAN (R 3.6.1)                             
 assertthat               0.2.1     2019-03-21 [1] CRAN (R 3.6.1)                             
 backports                1.1.5     2019-10-02 [1] CRAN (R 3.6.1)                             
 basejump               * 0.11.20   2019-10-30 [1] Github (acidgenomics/basejump@14de37c)     
 bb8                    * 0.2.2     2019-10-30 [1] Github (acidgenomics/bb8@3010b18)          
 Biobase                * 2.46.0    2019-10-29 [1] Bioconductor                               
 BiocFileCache            1.10.0    2019-10-29 [1] Bioconductor                               
 BiocGenerics           * 0.32.0    2019-10-29 [1] Bioconductor                               
 BiocManager              1.30.9    2019-10-23 [1] CRAN (R 3.6.1)                             
 BiocParallel           * 1.20.0    2019-10-30 [1] Bioconductor                               
 BiocVersion              3.10.1    2019-06-06 [1] Bioconductor                               
 biomaRt                  2.42.0    2019-10-29 [1] Bioconductor                               
 Biostrings               2.54.0    2019-10-29 [1] Bioconductor                               
 bioverbs                 0.2.10    2019-10-28 [1] Github (acidgenomics/bioverbs@9e1b179)     
 bit                      1.1-14    2018-05-29 [1] CRAN (R 3.6.1)                             
 bit64                    0.9-7     2017-05-08 [1] CRAN (R 3.6.1)                             
 bitops                   1.0-6     2013-08-17 [1] CRAN (R 3.6.1)                             
 blob                     1.2.0     2019-07-09 [1] CRAN (R 3.6.1)                             
 brio                     0.3.14    2019-10-25 [1] Github (acidgenomics/brio@427598b)         
 cli                      1.1.0     2019-03-19 [1] CRAN (R 3.6.1)                             
 codetools                0.2-16    2018-12-24 [2] CRAN (R 3.6.1)                             
 colorspace               1.4-1     2019-03-18 [1] CRAN (R 3.6.1)                             
 crayon                   1.3.4     2017-09-16 [1] CRAN (R 3.6.1)                             
 curl                     4.2       2019-09-24 [1] CRAN (R 3.6.1)                             
 data.table               1.12.6    2019-10-18 [1] CRAN (R 3.6.1)                             
 DBI                      1.0.0     2018-05-02 [1] CRAN (R 3.6.1)                             
 dbplyr                   1.4.2     2019-06-17 [1] CRAN (R 3.6.1)                             
 DelayedArray           * 0.12.0    2019-10-29 [1] Bioconductor                               
 digest                   0.6.22    2019-10-21 [1] CRAN (R 3.6.1)                             
 dplyr                  * 0.8.3     2019-07-04 [1] CRAN (R 3.6.1)                             
 ensembldb                2.10.0    2019-10-29 [1] Bioconductor                               
 fastmap                  1.0.1     2019-10-08 [1] CRAN (R 3.6.1)                             
 freerange                0.2.7     2019-10-23 [1] Github (acidgenomics/freerange@2ff4165)    
 fs                       1.3.1     2019-05-06 [1] CRAN (R 3.6.1)                             
 GenomeInfoDb           * 1.22.0    2019-10-29 [1] Bioconductor                               
 GenomeInfoDbData         1.2.2     2019-10-30 [1] Bioconductor                               
 GenomicAlignments        1.22.0    2019-10-29 [1] Bioconductor                               
 GenomicFeatures          1.38.0    2019-10-29 [1] Bioconductor                               
 GenomicRanges          * 1.38.0    2019-10-29 [1] Bioconductor                               
 ggplot2                  3.2.1     2019-08-10 [1] CRAN (R 3.6.1)                             
 glue                     1.3.1     2019-03-12 [1] CRAN (R 3.6.1)                             
 goalie                 * 0.4.0     2019-10-31 [1] Github (acidgenomics/goalie@ac0b393)       
 gridExtra                2.3       2017-09-09 [1] CRAN (R 3.6.1)                             
 grr                      0.9.5     2016-08-26 [1] CRAN (R 3.6.1)                             
 gtable                   0.3.0     2019-03-25 [1] CRAN (R 3.6.1)                             
 hms                      0.5.2     2019-10-30 [1] CRAN (R 3.6.1)                             
 htmltools                0.4.0     2019-10-04 [1] CRAN (R 3.6.1)                             
 httpuv                   1.5.2     2019-09-11 [1] CRAN (R 3.6.1)                             
 httr                     1.4.1     2019-08-05 [1] CRAN (R 3.6.1)                             
 interactiveDisplayBase   1.24.0    2019-10-29 [1] Bioconductor                               
 IRanges                * 2.20.0    2019-10-29 [1] Bioconductor                               
 jsonlite                 1.6       2018-12-07 [1] CRAN (R 3.6.1)                             
 knitr                    1.25      2019-09-18 [1] CRAN (R 3.6.1)                             
 later                    1.0.0     2019-10-04 [1] CRAN (R 3.6.1)                             
 lattice                  0.20-38   2018-11-04 [2] CRAN (R 3.6.1)                             
 lazyeval                 0.2.2     2019-03-15 [1] CRAN (R 3.6.1)                             
 magrittr               * 1.5       2014-11-22 [1] CRAN (R 3.6.1)                             
 Matrix                 * 1.2-17    2019-03-22 [2] CRAN (R 3.6.1)                             
 Matrix.utils             0.9.7     2018-04-19 [1] CRAN (R 3.6.1)                             
 matrixStats            * 0.55.0    2019-09-07 [1] CRAN (R 3.6.1)                             
 memoise                  1.1.0     2017-04-21 [1] CRAN (R 3.6.1)                             
 mime                     0.7       2019-06-11 [1] CRAN (R 3.6.1)                             
 monocle3               * 0.2.0     2019-09-25 [1] Github (cole-trapnell-lab/monocle3@9becd94)
 munsell                  0.5.0     2018-06-12 [1] CRAN (R 3.6.1)                             
 openssl                  1.4.1     2019-07-18 [1] CRAN (R 3.6.1)                             
 packrat                  0.5.0     2018-11-14 [1] CRAN (R 3.6.1)                             
 pillar                   1.4.2     2019-06-29 [1] CRAN (R 3.6.1)                             
 pkgconfig                2.0.3     2019-09-22 [1] CRAN (R 3.6.1)                             
 plyr                     1.8.4     2016-06-08 [1] CRAN (R 3.6.1)                             
 prettyunits              1.0.2     2015-07-13 [1] CRAN (R 3.6.1)                             
 progress                 1.2.2     2019-05-16 [1] CRAN (R 3.6.1)                             
 promises                 1.1.0     2019-10-04 [1] CRAN (R 3.6.1)                             
 ProtGenerics             1.18.0    2019-10-29 [1] Bioconductor                               
 pryr                   * 0.1.4     2018-02-18 [1] CRAN (R 3.6.1)                             
 purrr                    0.3.3     2019-10-18 [1] CRAN (R 3.6.1)                             
 R.methodsS3              1.7.1     2016-02-16 [1] CRAN (R 3.6.1)                             
 R.oo                     1.23.0    2019-11-03 [1] CRAN (R 3.6.1)                             
 R.utils                  2.9.0     2019-06-13 [1] CRAN (R 3.6.1)                             
 R6                       2.4.0     2019-02-14 [1] CRAN (R 3.6.1)                             
 rappdirs                 0.3.1     2016-03-28 [1] CRAN (R 3.6.1)                             
 Rcpp                     1.0.2     2019-07-25 [1] CRAN (R 3.6.1)                             
 RCurl                    1.95-4.12 2019-03-04 [1] CRAN (R 3.6.1)                             
 reshape2                 1.4.3     2017-12-11 [1] CRAN (R 3.6.1)                             
 reticulate             * 1.13      2019-07-24 [1] CRAN (R 3.6.1)                             
 rlang                    0.4.1     2019-10-24 [1] CRAN (R 3.6.1)                             
 Rsamtools                2.2.0     2019-10-29 [1] Bioconductor                               
 RSQLite                  2.1.2     2019-07-24 [1] CRAN (R 3.6.1)                             
 rstudioapi               0.10      2019-03-19 [1] CRAN (R 3.6.1)                             
 rtracklayer              1.46.0    2019-10-29 [1] Bioconductor                               
 S4Vectors              * 0.24.0    2019-10-29 [1] Bioconductor                               
 scales                   1.0.0     2018-08-09 [1] CRAN (R 3.6.1)                             
 sessioninfo              1.1.1     2018-11-05 [1] CRAN (R 3.6.1)                             
 shiny                    1.4.0     2019-10-10 [1] CRAN (R 3.6.1)                             
 SingleCellExperiment   * 1.8.0     2019-10-29 [1] Bioconductor                               
 stringi                  1.4.3     2019-03-12 [1] CRAN (R 3.6.1)                             
 stringr                  1.4.0     2019-02-10 [1] CRAN (R 3.6.1)                             
 SummarizedExperiment   * 1.16.0    2019-10-29 [1] Bioconductor                               
 syntactic                0.3.2     2019-10-30 [1] Github (acidgenomics/syntactic@56efb06)    
 tibble                   2.1.3     2019-06-06 [1] CRAN (R 3.6.1)                             
 tidyselect               0.2.5     2018-10-11 [1] CRAN (R 3.6.1)                             
 transformer              0.2.9     2019-10-25 [1] Github (acidgenomics/transformer@e43a981)  
 usethis                * 1.5.1     2019-07-04 [1] CRAN (R 3.6.1)                             
 vctrs                    0.2.0     2019-07-05 [1] CRAN (R 3.6.1)                             
 viridis                  0.5.1     2018-03-29 [1] CRAN (R 3.6.1)                             
 viridisLite              0.3.0     2018-02-01 [1] CRAN (R 3.6.1)                             
 withr                    2.1.2     2018-03-15 [1] CRAN (R 3.6.1)                             
 xfun                     0.10      2019-10-01 [1] CRAN (R 3.6.1)                             
 XML                      3.98-1.20 2019-06-06 [1] CRAN (R 3.6.1)                             
 xtable                   1.8-4     2019-04-21 [1] CRAN (R 3.6.1)                             
 XVector                  0.26.0    2019-10-29 [1] Bioconductor                               
 yaml                     2.2.0     2018-07-25 [1] CRAN (R 3.6.1)                             
 zeallot                  0.1.0     2018-01-28 [1] CRAN (R 3.6.1)                             
 zlibbioc                 1.32.0    2019-10-29 [1] Bioconductor                               

[1] /data00/R/site-library/3.6
[2] /usr/local/koopa/cellar/R/3.6.1/lib64/R/library

@TSun-tech
Copy link

TSun-tech commented Nov 7, 2019

I am seeing the same problem, but my script was running smoothly by the end of October.
This issue just occurred, and the test run using monocle3 test data hit the same problem.
For the test run I used script from https://cole-trapnell-lab.github.io/monocle3/docs/starting/#cell_data_set

The exact code is:
`# Load the data
expression_matrix <- readRDS(url("http://staff.washington.edu/hpliner/data/cao_l2_expression.rds"))
cell_metadata <- readRDS(url("http://staff.washington.edu/hpliner/data/cao_l2_colData.rds"))
gene_annotation <- readRDS(url("http://staff.washington.edu/hpliner/data/cao_l2_rowData.rds"))

cds <- new_cell_data_set(expression_matrix,
cell_metadata = cell_metadata,
gene_metadata = gene_annotation)`

@SuperSency
Copy link

Hello,
I met the same problem when I use 10x dataset from "Cell Ranger",I wonder if you solved this question about
Error in checkSlotAssignment(object, name, value) :
'reducedDims' is not a slot in class "SingleCellExperiment"
If you solved, please tell how to solve !
Thanks !

@mjsteinbaugh
Copy link
Contributor Author

@hpliner Following up on @LTLA's suggestion, reinstalling monocle3 fixes the issue for me. This should be safe to close.

@pcm32
Copy link

pcm32 commented Jan 28, 2020

Hi! @mjsteinbaugh @hpliner we work based on a conda setup, where re-installing monocle3 is not a practical option (because conda installs everything just once). We see the same error. Any ideas of why re-installing monocle3 fixes the issue? I'm using:

r-monocle3                0.2.0                     r36_0    bioconda
bioconductor-singlecellexperiment 1.8.0                     r36_0    bioconda

inside an R session in that conda environment I get:

> sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 3.6.2 (2019-12-12)
 os       macOS Mojave 10.14.5
 system   x86_64, darwin13.4.0
 ui       unknown
 language (EN)
 collate  en_GB.UTF-8
 ctype    en_GB.UTF-8
 tz       Europe/London
 date     2020-01-28

─ Packages ───────────────────────────────────────────────────────────────────
 package              * version  date       lib source
 assertthat             0.2.1    2019-03-21 [1] CRAN (R 3.6.1)
 Biobase              * 2.46.0   2019-10-29 [1] Bioconductor
 BiocGenerics         * 0.32.0   2019-10-29 [1] Bioconductor
 BiocParallel         * 1.20.0   2019-10-30 [1] Bioconductor
 bitops                 1.0-6    2013-08-17 [1] CRAN (R 3.6.1)
 cli                    2.0.1    2020-01-08 [1] CRAN (R 3.6.2)
 colorspace             1.4-1    2019-03-18 [1] CRAN (R 3.6.1)
 crayon                 1.3.4    2017-09-16 [1] CRAN (R 3.6.1)
 DelayedArray         * 0.12.0   2019-10-29 [1] Bioconductor
 dplyr                  0.8.3    2019-07-04 [1] CRAN (R 3.6.1)
 fansi                  0.4.1    2020-01-08 [1] CRAN (R 3.6.2)
 GenomeInfoDb         * 1.22.0   2019-10-29 [1] Bioconductor
 GenomeInfoDbData       1.2.2    2020-01-28 [1] Bioconductor
 GenomicRanges        * 1.38.0   2019-10-29 [1] Bioconductor
 ggplot2                3.2.1    2019-08-10 [1] CRAN (R 3.6.1)
 glue                   1.3.1    2019-03-12 [1] CRAN (R 3.6.1)
 gridExtra              2.3      2017-09-09 [1] CRAN (R 3.6.1)
 gtable                 0.3.0    2019-03-25 [1] CRAN (R 3.6.1)
 IRanges              * 2.20.0   2019-10-29 [1] Bioconductor
 lattice                0.20-38  2018-11-04 [1] CRAN (R 3.6.1)
 lazyeval               0.2.2    2019-03-15 [1] CRAN (R 3.6.1)
 lifecycle              0.1.0    2019-08-01 [1] CRAN (R 3.6.1)
 magrittr               1.5      2014-11-22 [1] CRAN (R 3.6.1)
 Matrix                 1.2-18   2019-11-27 [1] CRAN (R 3.6.2)
 matrixStats          * 0.55.0   2019-09-07 [1] CRAN (R 3.6.1)
 monocle3             * 0.2.0    2019-09-20 [1] local
 munsell                0.5.0    2018-06-12 [1] CRAN (R 3.6.1)
 pillar                 1.4.3    2019-12-20 [1] CRAN (R 3.6.2)
 pkgconfig              2.0.3    2019-09-22 [1] CRAN (R 3.6.1)
 plyr                   1.8.5    2019-12-10 [1] CRAN (R 3.6.1)
 purrr                  0.3.3    2019-10-18 [1] CRAN (R 3.6.1)
 R6                     2.4.1    2019-11-12 [1] CRAN (R 3.6.1)
 Rcpp                   1.0.3    2019-11-08 [1] CRAN (R 3.6.1)
 RCurl                  1.98-1.1 2020-01-19 [1] CRAN (R 3.6.2)
 reshape2               1.4.3    2017-12-11 [1] CRAN (R 3.6.1)
 rlang                  0.4.3    2020-01-24 [1] CRAN (R 3.6.2)
 S4Vectors            * 0.24.0   2019-10-29 [1] Bioconductor
 scales                 1.1.0    2019-11-18 [1] CRAN (R 3.6.1)
 sessioninfo            1.1.1    2018-11-05 [1] CRAN (R 3.6.1)
 SingleCellExperiment * 1.8.0    2019-10-29 [1] Bioconductor
 stringi                1.4.5    2020-01-11 [1] CRAN (R 3.6.2)
 stringr                1.4.0    2019-02-10 [1] CRAN (R 3.6.1)
 SummarizedExperiment * 1.16.0   2019-10-29 [1] Bioconductor
 tibble                 2.1.3    2019-06-06 [1] CRAN (R 3.6.1)
 tidyselect             1.0.0    2020-01-27 [1] CRAN (R 3.6.2)
 viridis                0.5.1    2018-03-29 [1] CRAN (R 3.6.1)
 viridisLite            0.3.0    2018-02-01 [1] CRAN (R 3.6.1)
 withr                  2.1.2    2018-03-15 [1] CRAN (R 3.6.1)
 XVector                0.26.0   2019-10-29 [1] Bioconductor
 zlibbioc               1.32.0   2019-10-29 [1] Bioconductor

Thanks!

@mjsteinbaugh
Copy link
Contributor Author

@pcm32 How are you managing your conda environments? With r-monocle3, I recommend keeping that recipe in a separate environment. Here's what I'm doing currently:

conda create --name="r-monocle3" r-monocle3
conda activate r-monocle3
R
library(monocle3)

Let me know if you're still seeing the reducedDims error in a clean environment and I'll see if the recipe needs to be updated.

Best,
Mike

pcm32 added a commit to bioconda/bioconda-recipes that referenced this issue Jan 28, 2020
@pcm32
Copy link

pcm32 commented Jan 28, 2020

Thanks @mjsteinbaugh, we use create as well every time to have a clean install, but the package that we install is monocle3-cli, which in turns depends on r-monocle3. The problem gets sorted if I pin in monocle3-cli to depend on bioconductor-singlecellexperiment below 1.8.0, but this is of course not ideal.

I'll try the direct example that you suggest and report back, but I suspect there must be something going on between monocle3 and singlecellexperiment.

@mjsteinbaugh
Copy link
Contributor Author

@pcm32 Refer to this issue posted in the SingleCellExperiment repo: drisso/SingleCellExperiment#43

@LTLA
Copy link

LTLA commented Jan 28, 2020

Any ideas of why re-installing monocle3 fixes the issue?

Each S4 class is created during package installation. As in, the definition of the class is created during installation and hard-coded into the contents of the monocle3 installation directory; in general, specific instances of the class are only created at run-time.

If you install monocle3 and then update SingleCellExperiment, the damage is already done; monocle3 defined its classes using the old SCE class at install-time, so updating SCE doesn't help any more. You need to re-install monocle3 to make use of the new class definition.

Normally, this would not be an issue; I take care to make sure that all downstream Bioconductor packages are happy when I change anything, so all Bioconductor packages should continue to work seamlessly. I can't be responsible for all the non-BioC packages floating around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants