Question: Add GenomicRanges to SummarizedExperiment
0
gravatar for s.w.vanderlaan
2.1 years ago by
Netherlands
s.w.vanderlaan40 wrote:

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

ADD COMMENTlink modified 20 months ago by WouterDeCoster36k • written 2.1 years ago by s.w.vanderlaan40

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

ADD REPLYlink written 2.1 years ago by Devon Ryan88k

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 REPLYlink written 2.1 years ago by s.w.vanderlaan40

Try the rowRanges() accessor.

ADD REPLYlink written 2.1 years ago by Devon Ryan88k

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 REPLYlink modified 20 months ago by WouterDeCoster36k • written 2.1 years ago by s.w.vanderlaan40
1

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 REPLYlink written 2.1 years ago by Devon Ryan88k

You can also use format = 'DataFrame'

ADD REPLYlink written 20 months ago by theobroma221.1k
0
gravatar for Sean Davis
20 months ago by
Sean Davis25k
National Institutes of Health, Bethesda, MD
Sean Davis25k wrote:

Using

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

or

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

should address the issue.

ADD COMMENTlink written 20 months ago by Sean Davis25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1181 users visited in the last hour