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 method on Template to fixmate information #83

Open
nh13 opened this issue Dec 22, 2023 · 0 comments · May be fixed by #182
Open

Add a method on Template to fixmate information #83

nh13 opened this issue Dec 22, 2023 · 0 comments · May be fixed by #182
Assignees
Labels
enhancement New feature or request

Comments

@nh13
Copy link
Member

nh13 commented Dec 22, 2023

Add a method fixmate on Template that will set mate flags and appropriate SAM tags. This is useful when we modify the records (e.g. clipping) in a template and want to update the tags.

For a code example, see fgbio's fixMateInfo and how it uses htsjdk's setMateInformationOnSupplementalAlignment. Note: we already have a method set_pair_info in fgpyo that will reset mate info for primary records in a pair where both records are mapped.

One can also validate this by running both/either fgbio SetMateInformation or samtools fixmate. Probably a good idea to do both.

Tests should include templates with:

  • only primary records
  • one or both ends unmapped
  • secondary records (are not updated)
  • supplementary records (are updated)

Ideally the fixmate method on Template routes to set_pair_info and creates a new method set_pair_info_on_supplementary, as these methods are useful in their own right.

@nh13 nh13 added the enhancement New feature or request label Jul 13, 2024
@TimD1 TimD1 self-assigned this Aug 13, 2024
TimD1 added a commit that referenced this issue Sep 3, 2024
- added fixmate() method
- added set_mate_info_on_supplementary() helper function
- moved builder._set_mate_info() to helper function set_mate_info()
- moved test_template_iterator.py to test_template.py (contained more than just iterator)
- added template_test_fixmate() tests
TimD1 added a commit that referenced this issue Sep 3, 2024
- added fixmate() method
- added set_mate_info_on_supplementary() helper function
- moved builder._set_mate_info() to helper function set_mate_info()
- moved test_template_iterator.py to test_template.py (contained more than just iterator)
- added template_test_fixmate() tests
@TimD1 TimD1 linked a pull request Sep 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants