"mask" values in a bedgraph
1
0
Entering edit mode
9.9 years ago
A. Domingues ★ 2.7k

I am trying to plot average conservation in a list of genomic features, and so far managed to do it successfully using a combination of the phastCons bigwig files (hg19.100way.phastCons.bw) and deepTools. However, as extra step, I want to re-do my analysis but this time by removing, or masking, the conservation values in the exons.

My first step, and the easiest, was to remove all features that overlap with exons, using bedtools intersect. This worked, bit seems like a crude way of doing it. So I am now trying to convert all phastCons values in exons to zero.

The question is: how to do it? Consider that I want a nice bigwig at end to input to deepTools. Initially I converted the phastCons bigwig to bedgraph, because it thought map from bedtools would work. It did not, so I am a bit out of ideas now.

bigwig conservation bedtools bedgraph • 2.2k views
ADD COMMENT
2
Entering edit mode
9.9 years ago
  1. Load the bigWig into R (see the import() function in rtracklayer).
  2. Load annotation GFF/GTF into R (see above).
  3. Use findOverlaps() to find which rows in your bedGraph overlap a feature (just prefilter the file) in the annotation file.
  4. Set the score of those features to 0.
  5. Export the results back as a bigWig file.

BTW, I'm interpreting your "I am not trying" as "I am now trying", since there's actually no way to mask values in these formats other than simply removing the associated positions.

ADD COMMENT
0
Entering edit mode

"I am now trying" is indeed correct :) I will edit the question. Thanks for the help.

ADD REPLY

Login before adding your answer.

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