Genomecov 0 or 1 based results?
1
1
Entering edit mode
8.1 years ago

Hi all,

From what I understand BED and BAM format are 0-based (but BED is exclusive on the stop).

I have to process precisely results from 'bedtools genomecov' and I don't agree with the results I found (if the previous statement is correct). To check this I created a 1 line BAM file (with the appropriate header):

read1    0       Chr3    5130    255     51M     *       0       0       ATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATG     CCCFFFFFHHHHHCGIJJJJJJJJJJJJJHIJJJJJJJJJJJJJIJJIJJJ

And I now try that:

bedtools genomecov -bg -split -strand + -ibam read1.bam

And get that:

Chr3    5129    5180    1

From what I understand, I should get:

Chr3    5130    5181    1

because the BAM is supposed to be already 0-based and the stop should be 5181 (5130+51).

Am I wrong somewhere?

Cheers,
Mathieu

bedtools • 1.9k views
ADD COMMENT
1
Entering edit mode
8.1 years ago

Ok sorry, I think I understood why. I'm looking at the BAM file but in the SAM format which 1-based.

ADD COMMENT
0
Entering edit mode

Yes this can be very confusing, the 0 based BAM applies only internally when you look at it with samtools it has already been converted. Thanks for following up with an answer.

ADD REPLY

Login before adding your answer.

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