DESeqDataSetFromTximport: Error in checkSlotAssignment
1
3
Entering edit mode
JWCarlson ▴ 80
@jwcarlson-10145
Last seen 7.6 years ago

I'm wrestling with tximport/DESeq2. I've create a small experiment dataset of 2 paired end fastq, generated counts with salmon, and successfully read them in with tximport (or so I think). "files" is my list of 2 quant.sf files. tx2gene is the obvious.

> txi <- tximport(files, type = "salmon", tx2gene = tx2gene)
> sampleTable
            tissue
sample1 young_leaf
sample2      roots

 

> dds <- DESeqDataSetFromTximport(txi, sampleTable, ~tissue)
Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class "NULL" is not valid for slot 'NAMES' in an object of class "DESeqDataSet"; is(value, "characterORNULL") is not TRUE

I've just recently installed R 3.4.0 and have update all packages. I see that there was some changes in S4 of renaming characterORNULL to character_OR_NULL; is this the issue?

Thanks

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)

Matrix products: default
BLAS: /global/u1/j/jcarlson/local/lib64/R/lib/libRblas.so
LAPACK: /global/u1/j/jcarlson/local/lib64/R/lib/libRlapack.so

locale:
[1] C

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

other attached packages:
 [1] tximport_1.4.0             DESeq2_1.16.0             
 [3] SummarizedExperiment_1.6.0 DelayedArray_0.2.0        
 [5] matrixStats_0.52.2         Biobase_2.36.0            
 [7] GenomicRanges_1.28.0       GenomeInfoDb_1.12.0       
 [9] IRanges_2.10.0             S4Vectors_0.14.0          
[11] BiocGenerics_0.22.0       

loaded via a namespace (and not attached):
 [1] genefilter_1.58.0       locfit_1.5-9.1          splines_3.4.0          
 [4] lattice_0.20-35         colorspace_1.3-2        htmltools_0.3.6        
 [7] base64enc_0.1-3         survival_2.41-3         XML_3.98-1.6           
[10] foreign_0.8-68          DBI_0.6-1               BiocParallel_1.10.0    
[13] RColorBrewer_1.1-2      GenomeInfoDbData_0.99.0 plyr_1.8.4             
[16] stringr_1.2.0           zlibbioc_1.22.0         munsell_0.4.3          
[19] gtable_0.2.0            htmlwidgets_0.8         memoise_1.1.0          
[22] latticeExtra_0.6-28     knitr_1.15.1            geneplotter_1.54.0     
[25] AnnotationDbi_1.38.0    htmlTable_1.9           Rcpp_0.12.10           
[28] acepack_1.4.1           xtable_1.8-2            scales_0.4.1           
[31] backports_1.0.5         checkmate_1.8.2         Hmisc_4.0-3            
[34] annotate_1.54.0         XVector_0.16.0          gridExtra_2.2.1        
[37] rjson_0.2.15            ggplot2_2.2.1           digest_0.6.12          
[40] stringi_1.1.5           grid_3.4.0              tools_3.4.0            
[43] bitops_1.0-6            magrittr_1.5            RSQLite_1.1-2          
[46] lazyeval_0.2.0          RCurl_1.95-4.8          tibble_1.3.0           
[49] Formula_1.2-1           cluster_2.0.6           Matrix_1.2-10          
[52] data.table_1.10.4       rpart_4.1-11            nnet_7.3-12            
[55] compiler_3.4.0         
deseq2 tximport • 6.0k views
ADD COMMENT
1
Entering edit mode

Hi Michael,

Thanks for the response.

biocLite() looks clean:

> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.0), R 3.4.0 (2017-04-21).

For a brief time, I thought my problem was that I was no pulling in tximportData. But adding that did not help.

Should I be concerned that the Class is -none- in the DESeqDataSet?

> summary(txi)
                    Length Class  Mode
abundance           72698  -none- numeric
counts              72698  -none- numeric
length              72698  -none- numeric
countsFromAbundance     1  -none- character

The error message almost makes sense if it's happening from trying to act on a null class.

ADD REPLY
0
Entering edit mode

Incidentally, I see that makeExampleDESeqDataSet() also returns the same error for me

> dds = makeExampleDESeqDataSet()
Error in checkSlotAssignment(object, name, value) : assignment of an object of class "NULL" is not valid for slot 'NAMES' in an object of class "DESeqDataSet"; is(value, "characterORNULL") is not TRUE

 

ADD REPLY
0
Entering edit mode

That's useful for debugging, isolating the problem to DESeq2 or its depends. Can you call traceback() after the error and post here?

ADD REPLY
0
Entering edit mode

sure!

> dds=makeExampleDESeqDataSet()
Error in checkSlotAssignment(object, name, value) :
  assignment of an object of class "NULL" is not valid for slot 'NAMES' in an object of class "DESeqDataSet"; is(value, "characterORNULL") is not TRUE
> traceback()
11: stop(gettextf("assignment of an object of class %s is not valid for slot %s in an object of class %s; is(value, \"%s\") is not TRUE",
        dQuote(valueClass), sQuote(name), dQuote(cl), slotClass),
        domain = NA)
10: checkSlotAssignment(object, name, value)
9: `slot<-`(`*tmp*`, what, value = slot(value, what))
8: asMethod(object, Class, value)
7: `as<-`(`*tmp*`, Classi, value = obj)
6: initialize(value, ...)
5: initialize(value, ...)
4: new("DESeqDataSet", se, design = design)
3: DESeqDataSet(se, design = design, ignoreRank)
2: DESeqDataSetFromMatrix(countData = countData, colData = colData,
       design = design, rowRanges = rowRanges)
1: makeExampleDESeqDataSet()

 

ADD REPLY
1
Entering edit mode
so this does not look right.

> showClass("DESeqDataSet")
Class "DESeqDataSet" [package "DESeq2"]

Slots:
<lines deleted>
Name:                      assays                      NAMES
Class:                     Assays            characterORNULL
<more lines deleted>
> showClass("RangedSummarizedExperiment")
Class "RangedSummarizedExperiment" [package "SummarizedExperiment"]

Slots:
<lines deleted>

Name:                      assays                      NAMES
Class:                     Assays          character_OR_NULL
<and so on>

RangedSummarizedExperiment has character_OR_NULL and DESeq2 has characterORNULL. I thought the latter was obsolete. This is also the one that shows up in the error message.

 

ADD REPLY
0
Entering edit mode

I'm starting to get more suspicious of the change in the S4Vectors package. Renaming characterORNULL to character_OR_NULL happened in 0.14.0 9 days ago.

What is your version of S4Vectors?

ADD REPLY
0
Entering edit mode

Does BiocInstaller::biocValid() point to any problems?

ADD REPLY
0
Entering edit mode

@JWCarlson found the workaround.. (he hit the 5-post limit)

The DESeq2 package will need to be tweaked to account for the latest change in S4Vectors.
Creating the class definitions:
setClassUnion("characterORNULL", c("character", "NULL”))
setClassUnion(“DataTableORNULL", c(“DataTable", "NULL”))
These were defined in the old S4Vectors but not in the latest version.

ADD REPLY
0
Entering edit mode

That is not the right solution. The slot NAMES comes from SummarizedExperiment; does SummarizedExperiment::SummarizedExperiment() work? Does getClass("SummarizedExperiment") show character_or_NULL ? Are there two versions of SummarizedExperiment installed, maybe tested with

> sum(dir(.libPaths()) == "SummarizedExperiment") != 1
[1] FALSE
ADD REPLY
1
Entering edit mode

Thanks Martin for helping to dive into this.

I just updated all Bioc packages on my machine and DESeq2 builds and passes CHECK as it does on Bioc servers.

ADD REPLY
0
Entering edit mode

I recognize that my setClassUnion call is a hack. It's a workaround until this gets sorted out and something to convince me that this really is the issue.

In answer to your questions, the constructor works and it shows character_OR_NULL. (As does RangedSummarizedExperiment; DESeqDataSet show NAMES is characterORNULL). And it looks like I have only 1 version installed.

> SummarizedExperiment::SummarizedExperiment()
class: SummarizedExperiment
dim: 0 0
metadata(0):
assays(0):
rownames: NULL
rowData names(0):
colnames: NULL
colData names(0):
> getClass("SummarizedExperiment")
Class "SummarizedExperiment" [package "SummarizedExperiment"]

Slots:

Name:            colData            assays             NAMES   elementMetadata
Class:         DataFrame            Assays character_OR_NULL         DataFrame

Name:           metadata
Class:              list

Extends:
Class "Vector", directly
Class "Annotated", by class "Vector", distance 2

Known Subclasses:
Class "RangedSummarizedExperiment", directly, with explicit coerce

> sum(dir(.libPaths()) == "SummarizedExperiment")
[1] 1
ADD REPLY
0
Entering edit mode

Here is what I get for the NAMES slot of DESeqDataSet today. I don't believe that the version bump in SummarizedExperiment is relevant. 

> library(DESeq2)
> library(tximport)
> testthat::test_file("~/bioc/DESeq2/DESeq2/tests/testthat/test_tximport.R")
tximport: .

DONE ===========================================================================

> showClass("DESeqDataSet")
Class "DESeqDataSet" [package "DESeq2"]

Slots:

Name:                      design         dispersionFunction
Class:                    formula                   function

Name:                   rowRanges                    colData
Class: GenomicRangesORGRangesList                  DataFrame

Name:                      assays                      NAMES
Class:                     Assays          character_OR_NULL

Name:             elementMetadata                   metadata
Class:                  DataFrame                       list

Extends:
Class "RangedSummarizedExperiment", directly
Class "SummarizedExperiment", by class "RangedSummarizedExperiment", distance 2
Class "Vector", by class "RangedSummarizedExperiment", distance 3
Class "Annotated", by class "RangedSummarizedExperiment", distance 4

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/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] parallel  stats4    stats     graphics  grDevices datasets  utils
[8] methods   base

other attached packages:
 [1] readr_1.1.0                tximportData_1.4.0
 [3] tximport_1.4.0             DESeq2_1.16.0
 [5] SummarizedExperiment_1.6.1 DelayedArray_0.2.0
 [7] matrixStats_0.52.2         Biobase_2.36.1
 [9] GenomicRanges_1.28.1       GenomeInfoDb_1.12.0
[11] IRanges_2.10.0             S4Vectors_0.14.0
[13] BiocGenerics_0.22.0        BiocInstaller_1.26.0
[15] testthat_1.0.2             devtools_1.12.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10            locfit_1.5-9.1          lattice_0.20-35
 [4] digest_0.6.12           R6_2.2.0                plyr_1.8.4
 [7] backports_1.0.5         acepack_1.4.1           RSQLite_1.1-2
[10] ggplot2_2.2.1           zlibbioc_1.22.0         lazyeval_0.2.0
[13] data.table_1.10.4       annotate_1.54.0         rpart_4.1-11
[16] Matrix_1.2-10           checkmate_1.8.2         splines_3.4.0
[19] BiocParallel_1.10.1     geneplotter_1.54.0      stringr_1.2.0
[22] foreign_0.8-68          htmlwidgets_0.8         RCurl_1.95-4.8
[25] munsell_0.4.3           compiler_3.4.0          base64enc_0.1-3
[28] htmltools_0.3.6         nnet_7.3-12             tibble_1.3.0
[31] gridExtra_2.2.1         htmlTable_1.9           GenomeInfoDbData_0.99.0
[34] Hmisc_4.0-3             XML_3.98-1.6            crayon_1.3.2
[37] withr_1.0.2             bitops_1.0-6            grid_3.4.0
[40] xtable_1.8-2            gtable_0.2.0            DBI_0.6-1
[43] magrittr_1.5            scales_0.4.1            stringi_1.1.5
[46] XVector_0.16.0          genefilter_1.58.0       latticeExtra_0.6-28
[49] Formula_1.2-1           rjson_0.2.15            RColorBrewer_1.1-2
[52] tools_3.4.0             hms_0.3                 survival_2.41-3
[55] AnnotationDbi_1.38.0    colorspace_1.3-2        cluster_2.0.6
[58] memoise_1.1.0           knitr_1.15.1
ADD REPLY
0
Entering edit mode
@mikelove
Last seen 19 hours ago
United States

Can you run biocLite() once again to grab any changes since the release?

The DESeqDataSetFromTximport example is working fine on the Bioc machines and on mine:

https://bioconductor.org/packages/release/bioc/vignettes/tximport/inst/doc/tximport.html#deseq2

ADD COMMENT
1
Entering edit mode

Thanks for your work on this Michael.

This is what I upgraded:

> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.0), R 3.4.0 (2017-04-21).
Old packages: 'Biobase', 'BiocParallel', 'GenomicRanges',
  'SummarizedExperiment'

I updated all. If I take out my setClassUnion hack, I still see:

> dds = DESeqDataSetFromTximport(txi, sampleTable, ~ tissue)
Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class "NULL" is not valid for slot 'NAMES' in an object of class "DESeqDataSet"; is(value, "characterORNULL") is not TRUE

It still works with my hack in place.

 

 

ADD REPLY
0
Entering edit mode

I'm kind of baffled. It seems like there is an older version of some packages sneaking in, but I don't know how or why.

ADD REPLY
0
Entering edit mode

Yes. It's a strange thing. When I look at showClass("DESeqDataSet"), NAMES is charcterORNULL. But your results show that it is character_OR_NULL.

I agree that from all appearances, my initialization of DESeqDataSet looks like it's pulling in an older version of S4Vectors. I've stepped through the initialization of DESeqDataSet and it looks to me that NAMES in S4Vectors inside the initialization of DESeqDataSet is characterORNULL. But I cannot find where that is done. I'll look some more and see if I can find it.

ADD REPLY
0
Entering edit mode

I had this issue. Turns out I had the new version installed on my machine as the root user but an older version of DESeq2 and BioCinstaller in my ~/R/x86_64-pc-linux-gnu-library/3.4. Manually removed the packages from my users local R library and reran bioClite() then it worked.

ADD REPLY

Login before adding your answer.

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