DESeqDataSetFromMatrix gives a 'dimnames are not identical error' in R 4.0 that worked fine in R 3.6.1.
0
Entering edit mode
Bio • 0
@bio-23985
Last seen 2 days ago

The code that used to work in R 3.6.1 is giving me an error in R 4.0. The exact error is discussed in the github thread at github/Bioconductor/SummarizedExperiment/ but I have trouble understanding how to address the issue based on the discussion there. The culprit is the following line:

DESeqDataSetFromMatrix(countData=RNASeqCnts$counts, colData=cData, design=~sex+group)

Which gives the error:

Error in `assays<-`(`*tmp*`, withDimnames = withDimnames, ..., value = `*vtmp*`) : please use 'assay(x, withDimnames=FALSE)) <- value' or 'assays(x, withDimnames=FALSE)) <- value' when the dimnames on the supplied assay(s) are not identical to the dimnames on RangedSummarizedExperiment object 'x' 

The variablle RNASeqCnts$counts is the output of the ReadsPerGene files from STAR. Head of the file looks like this:

                     Samples                                                                                                                                                 
 Tags       PM10LTA PM11LTA PM12LTA PM14LTA PM17RTA PM1LTA PM21LTA                                                                                                 
   ENSMUSG1       0       0       0       0       0      0       0                                                                                                 
   ENSMUSG2       0       0       0       0       0      0       0                                                                                                 
   ENSMUSG3       0       0       2       0       0      0       0                                                                                                 
   ENSMUSG4       0       0       0       0       0      0       0  

Please let me know if dim() information is also needed, and for which variables if that would help. I have included both sessionInfos at the end.

Thank you.

 R version 4.0.0 (2020-04-24)                                                                                                                                                
 Platform: x86_64-pc-linux-gnu (64-bit)                                                                                                                                      
 Running under: Red Hat Enterprise Linux Server release 6.10 (Santiago)                                                                                                      

 Matrix products: default                                                                                                                                                    
 BLAS:   /share/pkg/R/4.0.0_gcc/lib64/R/lib/libRblas.so                                                                                                                      
 LAPACK: /share/pkg/R/4.0.0_gcc/lib64/R/lib/libRlapack.so                                                                                                                    

 locale:                                                                                                                                                                     
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C                                                                                                                                
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8                                                                                                                      
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8                                                                                                                     
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                                                                                                                                   
  [9] LC_ADDRESS=C               LC_TELEPHONE=C                                                                                                                              
 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C                                                                                                                         

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

 other attached packages:                                                                                                                                                    
  [1] biomaRt_2.46.0              dplyr_1.0.2                                                                                                                                
  [3] edgeR_3.32.0                limma_3.46.0                                                                                                                               
  [5] DESeq2_1.30.0               SummarizedExperiment_1.20.0                                                                                                                
  [7] Biobase_2.50.0              MatrixGenerics_1.2.0                                                                                                                       
  [9] matrixStats_0.57.0          GenomicRanges_1.42.0                                                                                                                       
 [11] GenomeInfoDb_1.26.2         IRanges_2.24.1                                                                                                                             
 [13] S4Vectors_0.28.1            BiocGenerics_0.36.0                                                                                                                        
 [15] WGCNA_1.69                  fastcluster_1.1.25                                                                                                                         
 [17] dynamicTreeCut_1.63-1   

 loaded via a namespace (and not attached):                                                                                                                                  
  [1] bitops_1.0-6           bit64_4.0.5            progress_1.2.2                                                                                                           
  [4] doParallel_1.0.15      RColorBrewer_1.1-2     httr_1.4.2                                                                                                               
  [7] tools_4.0.0            backports_1.2.1        R6_2.5.0                                                                                                                 
 [10] rpart_4.1-15           Hmisc_4.4-2            DBI_1.1.0                                                                                                                
 [13] colorspace_2.0-0       nnet_7.3-14            prettyunits_1.1.1                                                                                                        
 [16] tidyselect_1.1.0       gridExtra_2.3          curl_4.3                                                                                                                 
 [19] bit_4.0.4              compiler_4.0.0         preprocessCore_1.52.0                                                                                                    
 [22] htmlTable_2.1.0        xml2_1.3.2             DelayedArray_0.16.0                                                                                                      
 [25] scales_1.1.1           checkmate_2.0.0        genefilter_1.72.0                                                                                                        
 [28] askpass_1.1            rappdirs_0.3.1         stringr_1.4.0                                                                                                            
 [31] digest_0.6.25          foreign_0.8-78         XVector_0.30.0                                                                                                           
 [34] base64enc_0.1-3        jpeg_0.1-8.1           pkgconfig_2.0.3                                                                                                          
 [37] htmltools_0.5.0        dbplyr_2.0.0           htmlwidgets_1.5.1                                                                                                        
 [40] rlang_0.4.8            rstudioapi_0.11        RSQLite_2.2.1                                                                                                            
 [43] impute_1.64.0          generics_0.1.0         BiocParallel_1.24.1                                                                                                      
 [46] RCurl_1.98-1.2         magrittr_1.5           GO.db_3.12.1                                                                                                             
 [49] GenomeInfoDbData_1.2.4 Formula_1.2-4          Matrix_1.2-18                                                                                                            
 [52] Rcpp_1.0.5             munsell_0.5.0          lifecycle_0.2.0   
 [55] stringi_1.4.6          zlibbioc_1.36.0        BiocFileCache_1.14.0                                                                                                     
 [58] grid_4.0.0             blob_1.2.1             crayon_1.3.4                                                                                                             
 [61] lattice_0.20-41        splines_4.0.0          annotate_1.68.0                                                                                                          
 [64] hms_0.5.3              locfit_1.5-9.4         knitr_1.28                                                                                                               
 [67] pillar_1.4.4           geneplotter_1.68.0     codetools_0.2-18                                                                                                         
 [70] XML_3.99-0.5           glue_1.4.1             latticeExtra_0.6-29                                                                                                      
 [73] data.table_1.13.6      png_0.1-7              vctrs_0.3.5                                                                                                              
 [76] foreach_1.5.0          openssl_1.4.1          gtable_0.3.0                                                                                                             
 [79] purrr_0.3.4            assertthat_0.2.1       ggplot2_3.3.3                                                                                                            
 [82] xfun_0.14              xtable_1.8-4           survival_3.1-12                                                                                                          
 [85] tibble_3.0.1           iterators_1.0.12       AnnotationDbi_1.52.0                                                                                                     
 [88] memoise_1.1.0          cluster_2.1.0          ellipsis_0.3.1
DESeq2 SummarizedExperiment • 92 views
ADD COMMENTlink
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

I'm wondering if you have a valid Bioc installation? Can you run BiocManager::valid()?

At some point I had to change the internal code of DESeq2 to add the withDimnames arguments, but I did so to match the updates to SummarizedExperiment. So if you have a valid installation it shouldn't be an issue.

Alternatively, I guess you could get around this by ensuring the rownames of colData and the colnames of counts are identical.

ADD COMMENTlink
0
Entering edit mode
BiocManager::valid()

* sessionInfo()

R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.10 (Santiago)

Matrix products: default
BLAS:   /share/pkg/R/4.0.0_gcc/lib64/R/lib/libRblas.so
LAPACK: /share/pkg/R/4.0.0_gcc/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] DESeq2_1.30.0               SummarizedExperiment_1.20.0
 [3] Biobase_2.50.0              MatrixGenerics_1.2.0       
 [5] matrixStats_0.57.0          GenomicRanges_1.42.0       
 [7] GenomeInfoDb_1.26.2         IRanges_2.24.1             
 [9] S4Vectors_0.28.1            BiocGenerics_0.36.0        
[11] WGCNA_1.69                  fastcluster_1.1.25         
[13] dynamicTreeCut_1.63-1      

loaded via a namespace (and not attached):
 [1] httr_1.4.2             bit64_4.0.5            splines_4.0.0         
 [4] foreach_1.5.1          Formula_1.2-4          BiocManager_1.30.10   
 [7] latticeExtra_0.6-29    blob_1.2.1             GenomeInfoDbData_1.2.4
[10] impute_1.64.0          pillar_1.4.7           RSQLite_2.2.2         
[13] backports_1.2.1        lattice_0.20-41        glue_1.4.2            
[16] digest_0.6.27          RColorBrewer_1.1-2     XVector_0.30.0        
[19] checkmate_2.0.0        colorspace_2.0-0       htmltools_0.5.0       
[22] preprocessCore_1.52.1  Matrix_1.3-2           XML_3.99-0.5          
[25] pkgconfig_2.0.3        genefilter_1.72.0      zlibbioc_1.36.0       
[28] xtable_1.8-4           purrr_0.3.4            GO.db_3.12.1          
[31] scales_1.1.1           jpeg_0.1-8.1           BiocParallel_1.24.1   
[34] annotate_1.68.0        htmlTable_2.1.0        tibble_3.0.4          
[37] generics_0.1.0         ggplot2_3.3.3          ellipsis_0.3.1        
[40] nnet_7.3-14            survival_3.2-7         magrittr_2.0.1        
[43] crayon_1.3.4           memoise_1.1.0          doParallel_1.0.16     
[46] foreign_0.8-81         tools_4.0.0            data.table_1.13.6     
[49] lifecycle_0.2.0        stringr_1.4.0          locfit_1.5-9.4        
[52] munsell_0.5.0          DelayedArray_0.16.0    cluster_2.1.0         
[55] AnnotationDbi_1.52.0   compiler_4.0.0         rlang_0.4.10          
[58] grid_4.0.0             RCurl_1.98-1.2         iterators_1.0.13      
[61] rstudioapi_0.13        htmlwidgets_1.5.3      bitops_1.0-6          
[64] base64enc_0.1-3        gtable_0.3.0           codetools_0.2-18      
[67] DBI_1.1.0              R6_2.5.0               gridExtra_2.3         
[70] knitr_1.30             dplyr_1.0.2            bit_4.0.4             
[73] Hmisc_4.4-2            stringi_1.5.3          Rcpp_1.0.5            
[76] geneplotter_1.68.0     vctrs_0.3.6            rpart_4.1-15          
[79] png_0.1-7              tidyselect_1.1.0       xfun_0.20             

Bioconductor version '3.12'

  * 53 packages out-of-date
  * 0 packages too new

create a valid installation with

  BiocManager::install(c(
    "backports", "BH", "callr", "cli", "clipr", "covr", "crosstalk", "devtools",
    "digest", "doParallel", "DT", "foghorn", "foreach", "fs", "gh", "git2r",
    "glue", "htmlwidgets", "httr", "hunspell", "iterators", "jsonlite",
    "knitr", "magrittr", "nloptr", "openssl", "PAIRADISE", "pillar", "pingr",
    "pkgbuild", "pkgdown", "processx", "ps", "R6", "Rcpp", "remotes", "rlang",
    "rmarkdown", "roxygen2", "rprojroot", "rstudioapi", "rvest", "spelling",
    "stringi", "sys", "testthat", "tibble", "tinytex", "usethis", "vctrs",
    "withr", "xfun", "xmlparsedata"
  ), update = TRUE, ask = FALSE)

more details: BiocManager::valid()$too_new, BiocManager::valid()$out_of_date

Warning message:
53 packages out-of-date; 0 packages too new 

I tried running the suggested BiocManager::install() but I always end up with these packages installing with a non-zero status. Is any of them needed for DESeq2?

ADD REPLYlink
0
Entering edit mode

This could explain the error you are seeing, but if you want to just fix the error without dealing with installation, you can try my alternative approach (remove conflicting names).

ADD REPLYlink
0
Entering edit mode

Thank you!

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
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.3