Entering edit mode
9.2 years ago
mathieu.bahin
▴
90
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
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.