Add GenomicRanges to SummarizedExperiment
1
0
Entering edit mode
7.2 years ago

Hi,

I've got RNAseq data which was processed and given to me in a text-file. The rows are EnsemblIDs, and the columns the individuals with their counts.

I've loaded these data, and ran DESeq2. Now I want to plot the log2 fold changes similar as is explained here: http://www.bioconductor.org/help/workflows/rnaseqGene/#plotting-fold-changes-in-genomic-space. Thing is, I need to 'manually' plug in the "GRanges" in the SummarizedExperiment object.

I could use some pointers - I have no idea how to start. Below the command I've used and the error message.

Code:

resGR <- results(RAW_DESeq2AF, lfcThreshold = 1, format = "GRanges")

Error:

>Error in results(RAW_DESeq2AF, lfcThreshold = 1, format = "GRanges") : 
>rowRanges is GRangesList and one or more GRanges have length 0. Use format='DataFrame' or 'GRangesList'

Thanks!

Sander

SummarizedExperiment GRanges DESeq2 • 3.0k views
ADD COMMENT
0
Entering edit mode

The error is telling you to try resGR <- results(RAW_DESeq2AF, lfcThreshold = 1, format = "GRangesList").

ADD REPLY
0
Entering edit mode

I know. But the point is: these genomic ranges aren't present in my DESeq2 object. Like at all. So how do I get them in manually?

ADD REPLY
0
Entering edit mode

Try the rowRanges() accessor.

ADD REPLY
0
Entering edit mode

I did, here's what I get.

> rowRanges(RAW_DESeq2A)
> GRangesList object of length 63677:
> $ENSG00000000003 
> GRanges object with 0 ranges and 0 metadata columns:
>    seqnames    ranges strand
>       <Rle> <IRanges>  <Rle>
> 
> $ENSG00000000005 
> GRanges object with 0 ranges and 0 metadata columns:
>      seqnames ranges strand
> 
> $ENSG00000000419 
> GRanges object with 0 ranges and 0 metadata columns:
>      seqnames ranges strand
> 
> ...
> <63674 more elements>
> -------
> seqinfo: no sequences
ADD REPLY
1
Entering edit mode

Then use that same accessor to replace it:

rowRanges(RAW_DESeq2A) = proper_GRangesObject_or_GRangesList

I presume that the GRangesList or GRanges object will need to be appropriately ordered.

ADD REPLY
0
Entering edit mode

You can also use format = 'DataFrame'

ADD REPLY
0
Entering edit mode
6.9 years ago

Using

resGR <- results(RAW_DESeq2AF, lfcThreshold = 1, format = "GRangesList")

or

resGR <- results(RAW_DESeq2AF, lfcThreshold = 1, format = "DataFrame")

should address the issue.

ADD COMMENT

Login before adding your answer.

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