Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

MD tag #30

Closed
JakeHagen opened this issue Aug 27, 2020 · 2 comments
Closed

MD tag #30

JakeHagen opened this issue Aug 27, 2020 · 2 comments

Comments

@JakeHagen
Copy link

Hi
I might be missing it, but is there anyway to access the information stored in the MD tag?

@xunjieli
Copy link
Contributor

The following snippet should do it. Let me know if you have more question.

#!/usr/bin/env python3.7
from nucleus.io import sam
sam_path = "test.sam"
with sam.SamReader(sam_path, parse_aux_fields=True) as reader:
  for read in reader:
    for tag in read.info:
       if tag == 'MD':
          print(read.info[tag].values[0].string_value)

@JakeHagen
Copy link
Author

ok great. I was missing the parse_aux_fields=True. Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants