Error DESeq2 plotCounts invalid class DESeqDataSet object undefined class for slot rowRanges GenomicRangesORGRangesList
1
0
Entering edit mode
I.Castanho ▴ 50
@icastanho-12922
Last seen 3.8 years ago

Hi,

I am getting a new error with DESeq2 and I have no idea why as these are commands I have run a million times. I really can't understand why it's not working anymore and I can't find any post of someone reporting this error before.

I have this object:

I am getting a new error with DESeq2 and I have no idea why! These are commands I have run a million times! I really can't understand why it's not working.
I have this object:

> dge
class: DESeqDataSet
dim: 19861 59
metadata(1): version
assays(1): counts
rownames(19861): Xkr4 Rp1 ... Uty Erdr1
rowData names(0):
colnames(59): K17 K18 ... T23 T24
colData names(1): group

And I want to plot the gene expression like this:

This is what I did before:

# Pld1
data <- plotCounts(dge, gene="Pld1", intgroup="group", xlab=NA, returnData=TRUE)
png(filename="genes/Pld1.png")
ggplot(data, aes(x=as.numeric(as.character(coldata$Age_months)), y=count, colour=coldata$Genotype)) +
    scale_colour_manual(values = c("#262626","#73B5BF")) +
    labs(title="Pld1", x="Age in months", y="Normalised counts", color="Genotypes") +
    theme(plot.title = element_text(hjust = 0.5)) +
    geom_point(position=position_jitter(width=.1,height=0), size=5) +
    geom_smooth(method="lm", fullrange=TRUE) # Add linear regression lines; se=TRUE (default) shows shaded confidence region; fullrange=TRUE to extend regression lines
dev.off()


And this is what I am trying to do now:

# Pld4
data <- plotCounts(dge, gene="Pld4", intgroup="group", xlab=NA, returnData=TRUE)
png(filename="genes/Pld4.png")
ggplot(data, aes(x=as.numeric(as.character(coldata$Age_months)), y=count, colour=coldata$Genotype)) +
    scale_colour_manual(values = c("#262626","#73B5BF")) +
    labs(title="Pld4", x="Age in months", y="Normalised counts", color="Genotypes") +
    theme(plot.title = element_text(hjust = 0.5)) +
    geom_point(position=position_jitter(width=.1,height=0), size=5) +
    geom_smooth(method="lm", fullrange=TRUE) # Add linear regression lines; se=TRUE (default) shows shaded confidence region; fullrange=TRUE to extend regression lines
dev.off()

In both cases (and all the other genes I did to date) this is what I get now:

> data <- plotCounts(dge, gene="Pld4", intgroup="group", xlab=NA, returnData=TRUE)
Error in validObject(object) :
  invalid class "DESeqDataSet" object: undefined class for slot "rowRanges" ("GenomicRangesORGRangesList")

In the most recent manual (August 2018) from DESeq2 at some point it says:
"arguments provided to SummarizedExperiment including rowRanges and metadata.
Note that for Bioconductor 3.1, rowRanges must be a GRanges or GRangesList,
with potential metadata columns as a DataFrame accessed and stored with
mcols. If a user wants to store metadata columns about the rows of the countData,
but does not have GRanges or GRangesList information, first construct the
DESeqDataSet without rowRanges and then add the DataFrame with mcols(dds)."

But I have absolutely no idea what this actually mean. Can someone please help me understand this error and how I can solve it?

Thank you.

deseq2 plotCounts rowRanges • 1.3k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

Critical to what's going on is that you likely switched versions of software between object creation and the latest time you tried to run the code. This could be because you are working on a cluster and R/Bioconductor were updated, or you did this on your own machine. As with all support site posts, can you include your sessionInfo()? Do you remember what version was used when you created the object originally?

Sometimes, when there is an error like this, it can be resolved with code such as:

dds <- updateObject(dds)
ADD COMMENT
0
Entering edit mode

Hi Michael,

 

Thank you  for replying so promptly. I was actually wondering if it had anything to do with possible system updates. I forgot to save the version of bioconductor from when I previously ran DESeq2, but DESeq2 version is the same. Details for the current sessionInfo() below.

 

R version 3.4.3 (2017-11-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

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

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

other attached packages:
 [1] RColorBrewer_1.1-2         pheatmap_1.0.10
 [3] ggplot2_3.0.0              dplyr_0.7.6
 [5] genefilter_1.58.1          RUVSeq_1.10.0
 [7] edgeR_3.18.1               limma_3.32.10
 [9] EDASeq_2.10.0              ShortRead_1.34.2
[11] GenomicAlignments_1.12.2   Rsamtools_1.28.0
[13] Biostrings_2.44.2          XVector_0.16.0
[15] BiocParallel_1.10.1        DESeq2_1.16.1
[17] SummarizedExperiment_1.8.1 DelayedArray_0.4.1
[19] matrixStats_0.54.0         Biobase_2.36.2
[21] GenomicRanges_1.30.3       GenomeInfoDb_1.14.0
[23] IRanges_2.12.0             S4Vectors_0.16.0
[25] BiocGenerics_0.24.0        BiocInstaller_1.28.0

ADD REPLY
0
Entering edit mode

Is there any way I could solve this now, without having to run everything again?

> dds <- updateObject(dds)
Error in validObject(result) :
  invalid class “DESeqDataSet” object: undefined class for slot "rowRanges" ("GenomicRangesORGRangesList")

 

ADD REPLY
0
Entering edit mode

I also tried updating DESeq2 and running everything again, but the errors persist.

ADD REPLY
0
Entering edit mode

This is the problem then. The update object methods for a SummerizedExperiment isn’t working. This is outside the scope of what I can fix in DESeq2. But to help you fix things, can you rebuild the object from counts and sample table?

ADD REPLY

Login before adding your answer.

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