Skip to content

Add bespoke classes for accessing SEQ and QUAL #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmarshall
Copy link
Member

Inspired by the request in #1346, “Faster Single-Base Access for Long Reads”:—

Instead of accessing SEQ (and eventually QUAL) via a str property, add classes that implement __getitem__, __str__, etc directly from the internal BAM representation. These classes can then be used to access subsequences and do other useful things that you would do with a str:

aln.query_bases[4]
aln.query_bases[3:12]
print(f"Sequence is {aln.query_bases}")
…etc…

without decoding the unrequested parts of the sequence data.

This demonstrates the idea. We will likely rename this and position it to become the principal way to access SEQ, deprecating query_sequence, and similarly for base qualities.

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

Successfully merging this pull request may close these issues.

1 participant