Author Topic: Can I use BEDOPS to compute stats of RNA-Seq coverage?  (Read 5605 times)

Nick

  • Newbie
  • *
  • Posts: 1
Can I use BEDOPS to compute stats of RNA-Seq coverage?
« on: February 17, 2015, 03:53:19 PM »
I have mapped my RNA-Seq data to a genome using tophat2. Now I have the BAM files and would like to produce stats about the read coverage by region (exons, introns, intergenic). I have the gtf file which I used with tophat2. So my input data is a BAM file and a GTF file. Can I use BEDOPS to get the desired output from this input?

AlexReynolds

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: Can I use BEDOPS to compute stats of RNA-Seq coverage?
« Reply #1 on: February 18, 2015, 11:53:41 AM »
The following sample script could potentially help you, with some modification for your inputs:

http://bedops.readthedocs.org/en/latest/content/usage-examples/smoothing-tags.html

You would remove smoothing by setting bin step and window sizes of 1 (basically, each base is a bin and window).

Also, in between the bam2bed and awk blocks, you would filter tags.bed by the desired region subcategory (exons, introns, etc.). To do this, grep the GTF file for the annotations, and look for tags that overlap the resulting annotations:

gtf2bed < annotations.gtf | grep 'exon' - | bedops --element-of 1 tags.bed - > tags_overlapping_exons.bed

Change the bedmap map file from tags.bed to tags_overlapping_exons.bed (or whatever the annotation category happens to be).

The end result will be tag counts over the annotation category.
« Last Edit: February 18, 2015, 12:10:39 PM by AlexReynolds »