caleblareau / mgatk

mgatk: mitochondrial genome analysis toolkit
http://caleblareau.github.io/mgatk
MIT License
98 stars 25 forks source link

getBarcode in chunk_barcoded_bam.py always returns barcode (and not umi) #75

Closed yaniv-el closed 11 months ago

yaniv-el commented 1 year ago

Hi,

If I understand the flow correctly, I think that the latest commit introduced a bug into chunk_barcoded_bam.py. The function getBarcode always returns the barcode_id tag even when asked for the umi_id one. This can easily be fixed by letting it return read.get_tag(tag_get)

Best, Yaniv

caleblareau commented 11 months ago

thanks for bringing this up-- I will push a new version tonight

caleblareau commented 11 months ago

Hi @yaniv-el, maybe I misunderstand your point-- I think the version is OK?

https://github.com/caleblareau/mgatk/commit/892daa1044c347ad4bd35057dc782da0359ea3c9

Since the get_tag function call is still parameterized by the sam tag (i.e. tag_get), then it would correctly return either the cell barcode or the UMI depending on when the function is called-- do you think otherwise?

yaniv-el commented 11 months ago

Hi,

In the version I have the line in the getBarcode function is: return read.get_tag(barcodeTag, tag_get)[0] Which ignores the tag_get parameter and always returns the barcode tag. Fixing it to: return read.get_tag(tag_get)[0] Seems to return the desired tag (barcode/umi).

Yaniv

caleblareau commented 11 months ago

Ah— got it; thanks for clarifying. Will update

On Jul 17, 2023, at 1:37 AM, yaniv-el @.***> wrote:



Hi,

In the version I have the line in the getBarcode function is: return read.get_tag(barcodeTag, tag_get)[0] Which ignores the tag_get parameter and always returns the barcode tag. Fixing it to: return read.get_tag(tag_get)[0] Seems to return the desired tag (barcode/umi).

Yaniv

— Reply to this email directly, view it on GitHubhttps://github.com/caleblareau/mgatk/issues/75#issuecomment-1637608444, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD32FYON6CHAC7ADNB64OPTXQT2TNANCNFSM6AAAAAAZ3A3RDI. You are receiving this because you commented.Message ID: @.***>

caleblareau commented 11 months ago

pushed v.0.6.9-- thank you for your edit @yaniv-el