This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Samtools depth with 0-based BED file

Hi everyone,

I have a question about using samtools with a BED file as input for coordinates. I used samtools depth with a zero-based BED file and I get one-based coordinates as output. For example, for the range chr1 9 10 in my BED file, I get the position chr1 10 as output from samtools. I assume that I would have to subtract 1 from the SAM positions to reformat to zero-based coordinates.

Am I doing this correctly?

Best
Lynn

samtools sam bam bed

1 answer

Yes, samtools output is 1-based. See e.g. https://github.com/samtools/samtools/issues/1063

Log in to answer this question.