Search
Question: How to preserve the strand of coverage in derfinder::regionMatrix() ?
0
13 months ago by
fruce_ki10
University of Dundee
fruce_ki10 wrote:

I am using derfinder (in region mode) for annotation-free DE. Then I want to match the DE regions to the nearest *upstream* known gene. For this it is important to know which strand the coverage is on.

However regionMatrix() produces regions that have no strand information. The result of fullCoverage has not strand information either. The $regions element of the regionMatrix output is already a GRanges object and I cannot think of any good reason why someone would define coverage regions as strand agnostic by default. Is there a way to preserve or at least recover this information? I cannot find a relevant option in the derfinder documentation or a workaround posted somewhere on the web. Thanks! PS. Our HPC runs R -3.3.3 with derfinder-1.8.5 (not the most recent, but I can't find relevant documentation in 1.10.6 either). Updating packages on the HPC is a pain and prone to domino-effect errors, so any suggestions for a workaround that I could implement to re-add the strand information to the$regions (as opposed to using the latest dev version derfinder, should Leonardo decide to add the option) would be much appreciated!

modified 13 months ago by Leonardo Collado Torres610 • written 13 months ago by fruce_ki10
0
13 months ago by
United States

Hi,

If you have stranded RNA-seq data you have to process each strand separately. If you have BAM files, that means using the appropriate Rsamtools::scanBamFlag() information. If you have BigWig files for each strand, then that means importing the data for one strand at a time. You can then add the strand to the \$regions() output manually for the results for each strand.

Best,

Leonardo