mitreac / b575f19

UM DCMB BIOINF 575 Fall 2019 class repo
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Does bamnostic start `read.pos` at 0 or 1? #11

Open CooperStansbury opened 5 years ago

CooperStansbury commented 5 years ago

Does the bamnostic tool start read position, w.r.t. to the reference at '0' or '1'?

Thanks,

mitreac commented 5 years ago

read.pos is 0-based, see details from the documentation below.

All direct access attributes will be treated as 0-based, so as to fit in line with common Python conventions. The print() output of a read is always guaranteed to be a valid SAM entry, which is 1-based. Sequence Alignment Map (SAM) entry (see SAM format).

https://bamnostic.readthedocs.io/en/latest/quickstart.html#exploring-a-read https://bamnostic.readthedocs.io/en/latest/quickstart.html#based-start-position-raw-aligned-reference https://github.com/betteridiot/bamnostic

betteridiot commented 5 years ago

I like that you are not the first to ask this question.This really shows that people know their stuff.

Cristina is correct. BAMnostic is 0-based (unless printing). This is to ensure a common Python convention that also follows the pysam API.

However, I didn't explain this because I know it can confuse people really quickly. I just wanted/expected people to assume 20 == 20. Thanks for asking though.