Question: per bp depth intersected with gff file
gravatar for Biomonika (Noolean)
4.0 years ago by
State College, PA, USA
Biomonika (Noolean)3.0k 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.2k views
ADD COMMENTlink modified 4.0 years ago by Devon Ryan88k • written 4.0 years ago by Biomonika (Noolean)3.0k

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 4.0 years ago by Devon Ryan88k
gravatar for Devon Ryan
4.0 years ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k 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 4.0 years ago by Devon Ryan88k
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: 2111 users visited in the last hour