Bedtools coverage histogram
1
0
Entering edit mode
3.5 years ago
User000 ▴ 720

Hello,

I am following this tutorial in order to plot che coverage depth for my target exomes: Visualize coverage for targeted NGS (exome) experiments. I also want to produce a plot similar to the post.

So I am using the following command line for all my bam files:

bedtools coverage -hist -abam {} -b input.bed | grep ^all > {}.hist.all.txt

I get an output where depth of coverage is either 0 or 1. But in the plot from the post the values are from 0 to 400. If i change bam files as -b and bed file as -a the output is empty. Why is that and what am I doing wrong?

all     0       697333613       802606707       0.5315176
all     1       105273094       802606707       0.4684824
bedtools • 3.1k views
ADD COMMENT
0
Entering edit mode

Could you show us the plot ? How to add an image on Biostars.

ADD REPLY
0
Entering edit mode

Hi,

I am experiencing exactly the same issue. Were you able to solve it?

Thanks in advance. Victor

ADD REPLY
0
Entering edit mode

I don't entirely know if this is the issue, but the post that you linked was made in 2014 and I can confidently say that bedtools has updated their scripts since then. When I look at the documentation for the latest version of bedtools (v 2.30.0) I don't see -hist as a parameter for bedtools genomecov, but there may be backward compatibility...

What version of bedtools are you using? What happens if you upgrade and revise your code to use this latest version?

ADD REPLY
0
Entering edit mode

Actually, the tool is bedtools coverage and not genomecov, and -hist is still an option. From v 2.24, bam file is included as -b and bed file as -a, as User000 mentioned. I have used v2.29 and 2.30, but the problem is the same for both (at least in my case).

ADD REPLY
1
Entering edit mode

Hi, I did solve this, but I do not remember, almost 2 years ago. I sued this version of bedtools if you want to give it a try: bedtools2-2.19.0

ADD REPLY
0
Entering edit mode
2.1 years ago
ED • 0

Maybe this post helps: post, your output seems as if you switched the -a and -b option and the files you give it. I had a similar thing happen to me. -a input.bed (e.g. your targets) and -b input.bam (e.g. your alignment file). Don't use -abam. Everything is explained in the post.

ADD COMMENT

Login before adding your answer.

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