Question: per bp depth intersected with gff file
gravatar for Biomonika (Noolean)
5.5 years ago by
State College, PA, USA
Biomonika (Noolean)3.1k wrote:

Hi all,

I have a bam file and gff file and need to report per base coverage for all intervals (features) from gff file. Instead of having 0 coverage for all bps outside those regions, I simply need them not to be reported. I am familiar with bedtools and examined few tools, such as bedtools intersect, bedtools genomecov and bedtools coverage, but I don't seem to find the exact commands (yet). Number of reads per feature won't help me, I truly need per bp report. Thanks a lot:)

depth coverage bam bedtools • 1.5k views
ADD COMMENTlink modified 5.5 years ago by Devon Ryan96k • written 5.5 years ago by Biomonika (Noolean)3.1k

Have you considered just using samtools? Namely: samtools depth -b foo.bed sample.bam? That won't double count overlapping paired end reads and should only print regions specified in the BED file. Remember to convert from 1-based to 0-based coordinates!

ADD REPLYlink written 5.5 years ago by Devon Ryan96k
gravatar for Devon Ryan
5.5 years ago by
Devon Ryan96k
Freiburg, Germany
Devon Ryan96k wrote:

You should be able to use bedtools coverage piped to awk. The formatting of the output from coverage with the -d option may or may not be that useful for you, but you can convert it to whatever you want with awk.

ADD COMMENTlink written 5.5 years ago by Devon Ryan96k
Please log in to add an answer.


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