Failed to find a rowRanges() method
0
Entering edit mode
@syednajeebashraf-19986
Last seen 6 weeks ago

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 • 157 views
ADD COMMENTlink
0
Entering edit mode

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

ADD REPLYlink
0
Entering edit mode
ATpoint • 480
@atpoint-13662
Last seen 8 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 COMMENTlink
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 REPLYlink
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 REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Traffic: 228 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.4