Failed to find a rowRanges() method
1
0
Entering edit mode
@syednajeebashraf-19986
Last seen 2.3 years ago
Qatar

Dear team,

I am trying to run very simple DESeq2 snippets but I am getting some unexpected error.

Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) : Failed to find a rowRanges() method for RangedSummarizedExperiment objects


colnames(expression.matrix) <- gsub(x = colnames(expression.matrix),pattern = "RNASeq_",replacement = "")
colnames(expression.matrix) <- gsub(x = colnames(expression.matrix),pattern = "__merged.trimmed",replacement = "")
expression.matrix = expression.matrix %>% as.data.frame()
coldata = data.frame(colnames(expression.matrix),cond=1)
rownames(coldata) = coldata$colnames.expression.matrix.
coldata$colnames.expression.matrix.=NULL
dds = DESeqDataSetFromMatrix(expression.matrix, colData =coldata, design = ~ cond)
sessionInfo( )
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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 utils     datasets  methods   base     

other attached packages:
 [1] DESeq2_1.28.1               SummarizedExperiment_1.18.2 DelayedArray_0.16.0         MatrixGenerics_1.2.0       
 [5] matrixStats_0.57.0          Matrix_1.3-2                Biobase_2.48.0              GenomicRanges_1.40.0       
 [9] GenomeInfoDb_1.24.2         IRanges_2.24.1              S4Vectors_0.28.1            BiocGenerics_0.36.0        

loaded via a namespace (and not attached):
 [1] genefilter_1.70.0         tinytex_0.29              locfit_1.5-9.4            tidyselect_1.1.0          xfun_0.20                
 [6] purrr_0.3.4               splines_4.0.0             lattice_0.20-41           colorspace_2.0-0          vctrs_0.3.6              
[11] generics_0.1.0            blob_1.2.1                XML_3.99-0.5              survival_3.2-7            rlang_0.4.10             
[16] pillar_1.4.7              glue_1.4.2                DBI_1.1.1                 BiocParallel_1.22.0       bit64_4.0.5              
[21] RColorBrewer_1.1-2        GenomeInfoDbData_1.2.3    lifecycle_0.2.0           zlibbioc_1.34.0           munsell_0.5.0            
[26] gtable_0.3.0              memoise_1.1.0             geneplotter_1.66.0        AnnotationDbi_1.50.3      Rcpp_1.0.6               
[31] xtable_1.8-4              scales_1.1.1              annotate_1.66.0           XVector_0.28.0            bit_4.0.4                
[36] ggplot2_3.3.3             digest_0.6.27             dplyr_1.0.3               grid_4.0.0                tools_4.0.0              
[41] bitops_1.0-6              magrittr_2.0.1            RCurl_1.98-1.2            tibble_3.0.5              RSQLite_2.2.2            
[46] crayon_1.3.4              tidyr_1.1.2               pkgconfig_2.0.3           ellipsis_0.3.1            DelayedMatrixStats_1.10.1
[51] sparseMatrixStats_1.0.5   assertthat_0.2.1          rstudioapi_0.13           R6_2.5.0                  compiler_4.0.0  


## My expressio matrix looks like below
dput(head(expression.matrix))
structure(c(183L, 668L, 2L, 0L, 0L, 0L, 2L, 1063L, 1L, 0L, 0L, 
0L, 0L, 853L, 0L, 0L, 0L, 0L, 0L, 414L, 0L, 0L, 0L, 0L, 2L, 909L, 
0L, 0L, 0L, 0L, 0L, 1196L, 0L, 0L, 0L, 0L, 3L, 840L, 0L, 0L, 
0L, 0L, 8L, 929L, 0L, 0L, 0L, 0L, 0L, 335L, 0L, 0L, 0L, 0L, 8L, 
1502L, 0L, 0L, 0L, 0L, 0L, 355L, 0L, 0L, 0L, 0L, 0L, 289L, 0L, 
0L, 0L, 0L, 4L, 1618L, 0L, 0L, 0L, 0L, 2L, 472L, 0L, 0L, 0L, 
0L, 0L, 390L, 0L, 0L, 0L, 0L, 0L, 637L, 0L, 0L, 0L, 0L, 0L, 1105L, 
0L, 0L, 0L, 0L, 2L, 765L, 1L, 0L, 0L, 0L), .Dim = c(6L, 18L), .Dimnames = list(
    c("DDX11L1", "WASH7P", "MIR1302-10", "FAM138A", "OR4G4P", 
    "OR4G11P"), c("T12", "T13", "T14", "T16", "T1", "T21", "T23", 
    "T26", "T29", "T30", "T32", "T33", "T35", "T37", "T40", "T42", 
    "T4", "T8")))
DESeq2 • 3.5k views
ADD COMMENT
0
Entering edit mode

I updated the latest Bioconductor and then update the DeSEQ2 with all the dependencies and then it worked. Thanks !!

ADD REPLY
0
Entering edit mode
ATpoint ★ 4.5k
@atpoint-13662
Last seen 29 minutes ago
Germany

I cannot reproduce this based on the example data. Many lines are actually unnecessary. This should work, try to get the logic, and also double check with the manual. It might be that thos line with rownames you have (which is unnecessary) messed things up. Try:

library(DESeq2)

expression.matrix <- 
structure(c(183L, 668L, 2L, 0L, 0L, 0L, 2L, 1063L, 1L, 0L, 0L, 
            0L, 0L, 853L, 0L, 0L, 0L, 0L, 0L, 414L, 0L, 0L, 0L, 0L, 2L, 909L, 
            0L, 0L, 0L, 0L, 0L, 1196L, 0L, 0L, 0L, 0L, 3L, 840L, 0L, 0L, 
            0L, 0L, 8L, 929L, 0L, 0L, 0L, 0L, 0L, 335L, 0L, 0L, 0L, 0L, 8L, 
            1502L, 0L, 0L, 0L, 0L, 0L, 355L, 0L, 0L, 0L, 0L, 0L, 289L, 0L, 
            0L, 0L, 0L, 4L, 1618L, 0L, 0L, 0L, 0L, 2L, 472L, 0L, 0L, 0L, 
            0L, 0L, 390L, 0L, 0L, 0L, 0L, 0L, 637L, 0L, 0L, 0L, 0L, 0L, 1105L, 
            0L, 0L, 0L, 0L, 2L, 765L, 1L, 0L, 0L, 0L), .Dim = c(6L, 18L), .Dimnames = list(
              c("DDX11L1", "WASH7P", "MIR1302-10", "FAM138A", "OR4G4P", 
                "OR4G11P"), c("T12", "T13", "T14", "T16", "T1", "T21", "T23", 
                              "T26", "T29", "T30", "T32", "T33", "T35", "T37", "T40", "T42", 
                              "T4", "T8")))

#/ The colnames do not have any identifier that separates the groups,
#/ for the sake of this example I simply assume the first 9 are group "A"
#/ and the last 9 are "B".
#/ No rownames are necessary, it is anyway assumed that the order of the rows colData is the same as for the columns in the expression matrix
coldata = data.frame(cond=factor(c(rep("A", 9), rep("B", 9))))

#/ No need to either transform the expression matrix to data.frame, nor to rename the rownames
#/ as (at least in the dput you show) the rows are already the gene names as it should be
dds = DESeqDataSetFromMatrix(expression.matrix, colData = coldata, design = ~ cond)
ADD COMMENT
0
Entering edit mode

i am getting same error with above example as well.

````

dds = DESeqDataSetFromMatrix(expression.matrix, colData = coldata, design = ~ cond)

Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) : Failed to find a rowRanges() method for RangedSummarizedExperiment objects.

ADD REPLY
0
Entering edit mode

What happens if you do the example from the function:

countData <- matrix(1:100,ncol=4)
condition <- factor(c("A","A","B","B"))
dds <- DESeqDataSetFromMatrix(countData, DataFrame(condition), ~ condition)
ADD REPLY
0
Entering edit mode

I tried your example above and got the same error. I believe i have updated everything. and my BiocManager::valid("DESeq2") came back "TRUE".

anyone has other suggestions on how to fix the issue?

ADD REPLY
0
Entering edit mode

What about BiocManager::valid()?

ADD REPLY
0
Entering edit mode

Thanks Michael for your reply. i ran it and i have this. I am thinking maybe i need to delete all my libraries and install it again?

  • sessionInfo()

R version 4.0.0 (2020-04-24) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS: /software/statistical/R-4.0.0/lib64/R/lib/libRblas.so LAPACK: /software/statistical/R-4.0.0/lib64/R/lib/libRlapack.so

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

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

other attached packages: [1] BiocManager_1.30.18 topGO_2.40.0 GO.db_3.11.1 AnnotationDbi_1.52.0
[5] SparseM_1.78 graph_1.66.0 pheatmap_1.0.12 DESeq2_1.30.1
[9] SummarizedExperiment_1.18.1 DelayedArray_0.16.3 MatrixGenerics_1.2.1 Matrix_1.4-1
[13] GenomicRanges_1.42.0 GenomeInfoDb_1.26.7 matrixStats_0.62.0 Biobase_2.50.0
[17] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.1 RColorBrewer_1.1-3
[21] ggrepel_0.9.1 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.9
[25] purrr_0.3.4 tidyr_1.2.0 tibble_3.1.7 ggplot2_3.3.6
[29] tidyverse_1.3.0 readr_1.3.1 tximport_1.16.0 forestmangr_0.9.3

loaded via a namespace (and not attached): [1] bitops_1.0-7 fs_1.4.1 lubridate_1.7.10 bit64_4.0.5 httr_1.4.2
[6] tools_4.0.0 backports_1.2.1 utf8_1.2.2 R6_2.5.1 DBI_1.1.2
[11] colorspace_2.0-3 withr_2.4.3 tidyselect_1.1.2 bit_4.0.4 compiler_4.0.0
[16] cli_3.3.0 rvest_0.3.5 xml2_1.3.2 scales_1.2.0 genefilter_1.70.0
[21] digest_0.6.29 rmarkdown_2.14 R.utils_2.9.2 XVector_0.30.0 pkgconfig_2.0.3
[26] htmltools_0.5.2 dbplyr_2.2.0 fastmap_1.1.0 rlang_1.0.2 readxl_1.3.1
[31] rstudioapi_0.13 RSQLite_2.2.14 generics_0.1.2 jsonlite_1.7.2 BiocParallel_1.24.1
[36] R.oo_1.23.0 RCurl_1.98-1.6 magrittr_2.0.3 GenomeInfoDbData_1.2.4 Rcpp_1.0.8.3
[41] munsell_0.5.0 fansi_1.0.3 lifecycle_1.0.1 R.methodsS3_1.8.0 yaml_2.3.5
[46] stringi_1.7.5 zlibbioc_1.36.0 grid_4.0.0 blob_1.2.3 crayon_1.5.1
[51] RLinuxModules_0.4 lattice_0.20-45 haven_2.2.0 splines_4.0.0 annotate_1.66.0
[56] hms_0.5.3 locfit_1.5-9.4 knitr_1.39 pillar_1.7.0 geneplotter_1.66.0
[61] reprex_0.3.0 XML_3.99-0.9 glue_1.6.2 evaluate_0.15 data.table_1.14.2
[66] modelr_0.1.7 vctrs_0.4.1 cellranger_1.1.0 gtable_0.3.0 assertthat_0.2.1
[71] cachem_1.0.6 xfun_0.31 xtable_1.8-4 broom_0.7.6 survival_3.3-1
[76] memoise_2.0.1 ellipsis_0.3.2

Bioconductor version '3.12'

  • 659 packages out-of-date
  • 0 packages too new
ADD REPLY
0
Entering edit mode

The Bioc packages should work together on instances where valid() returns no out-of-date packages. Here your R and Bioc are not in sync which often leads to issues with the core classes, as you are finding above.

ADD REPLY
0
Entering edit mode

oh... I will update them and see what happens. Thank you very much Michael.

ADD REPLY

Login before adding your answer.

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