Entering edit mode
8 months ago
marco.barr
▴
150
Hello everyone, is there an option in samtools depth (or any other way) to obtain an output that considers 0-based coordinates? Or do I need to modify my BAM files and subtract 1 from each position? Thank you very much.
Thank you! What do you mean by 'no tested'? The only thing I don't understand is why Samtools provides a 1-based output when generally a Bam format file uses a 0-based coordinate system? Maybe it depends on the aligner?
i did not test my command line. I hope it works.
Provided code should logically work but has not actually been tested in practice. You can do that and if something does not work the post back here.
Please see the discussion by developers here: https://github.com/samtools/samtools/issues/1063
Thank you very much for your explanation! It is well explained in the discussion.
SAM is 1 based https://samtools.github.io/hts-specs/SAMv1.pdf
BAM is ALWAYS 0 based. you don't look at the values in a BAM unless you're a programmer.
Your command works, It starts from chr 0 and shifts the coverage by 1