Skip to content
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

rust-htslib read_pos #91

Open
jblachly opened this issue Aug 3, 2021 · 2 comments
Open

rust-htslib read_pos #91

jblachly opened this issue Aug 3, 2021 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@jblachly
Copy link
Member

jblachly commented Aug 3, 2021

Do we have an equivalent of this?

https://github.com/rust-bio/rust-htslib/blob/622a0996fee4c03674bfcebd16c3876258c28a5b/src/bam/record.rs#L1999-L2008

@jblachly jblachly added enhancement New feature or request question Further information is requested labels Aug 3, 2021
@charlesgregory
Copy link
Contributor

In a way getAlignedPairs can be subsetted.

/// get a range of aligned read and reference positions
/// this is meant to recreate functionality from pysam:
/// https://pysam.readthedocs.io/en/latest/api.html#pysam.AlignedSegment.get_aligned_pairs
/// range is 0-based half open using chromosomal coordinates
auto getAlignedPairs(bool withRefSeq)(long start, long end)

It returns a range of AlignedPairs that contain rpos, qpos, cigar op, query base, and potentially reference base (if MD tag is present).

@jblachly
Copy link
Member Author

jblachly commented Aug 5, 2021

Interesting that rust-htslib wrote a long function for this; seems useful. keep in back of your mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants