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

Add a Template struct and a TemplateIterator #20

Open
msto opened this issue Jan 17, 2025 · 2 comments
Open

Add a Template struct and a TemplateIterator #20

msto opened this issue Jan 17, 2025 · 2 comments

Comments

@msto
Copy link

msto commented Jan 17, 2025

Summary

fgbio and fgpyo provide implementations for a Template struct, collecting all alignment records associated with the same queryname and template, and a TemplateIterator, which can iterate over a queryname-grouped BAM and yield Template instances. It would be useful to carry these objects and patterns over to Rust.

To the extent possible and sensible, the API should be consistent with those implemented by fgbio and fgpyo.

Prior art

Suggested solution

An initial MVP to address this issue would implement:

  1. A Template struct to contain R1 and R2 primary alignments, and lists of R1 and R2 supplemental and secondary alignments.
  2. A TemplateIterator that consumes a queryname-grouped BAM and yields an iteration of Template structs

Additional logic associated with Template, e.g. fixing mate info, may be addressed in later PRs

@msto
Copy link
Author

msto commented Jan 17, 2025

edit: Per Tim's comment below, records marked as both secondary and supplementary should be placed in the list of secondary alignments.

See also this recent PR - records marked as both secondary and supplementary should be placed in the list of supplementary alignments.

@tfenne
Copy link
Member

tfenne commented Jan 17, 2025

See also this recent PR - records marked as both secondary and supplementary should be placed in the list of supplementary alignments

I think that on reflection @nh13 and I have a difference of opinion on that PR and feel that secondary-supplementary records should end up in the list of secondary alignments. This is how it's done in fgbio, and having thought more on it, I prefer that.

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

No branches or pull requests

2 participants