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

Improve mpileup overlap removal #1751

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Commits on Feb 16, 2024

  1. Improve mpileup overlap removal for deletions

    The code previously just skipped deletions, meaning templates with a
    deletion in one copy and not in the other could still be reported
    twice in the mpileup.  Note this depended on what came first due to
    the order of iref updates.
    
    The new code moves the two iref updates to after the two
    cigar_iref2iseq_next so we're always consistently getting the next
    reference base regardless.
    
    We then detect deletions and catch the lagging sequence up, applying
    the same Q*=0.8 or Q=0 logic that the mismatching base code does.
    
    It's tricky to know if this has a beneficial impact on variant calling
    or not!  If there is debate over whether a deletion exists between the
    read-pairs, then it is probably not something we wish to take into
    account, however it's currently random which read we select.
    Previously we'd have had both deletions and not-deletion present in
    the results, over-inflating depth but maybe bringing less confidence
    to such deletion calls.  However it is at least consistent with the
    stated intention of overlap removal.
    
    One possible further mitigation could be to reduce quality more around
    such positions (so not just Q*0.8, and also adjusting the before/after
    base too for the deletion read).  That hasn't been done here though.
    
    Fixes samtools/samtools#1992
    jkbonfield committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    426e9f8 View commit details
    Browse the repository at this point in the history
  2. Extend pileup test to include quality values.

    Without this we cannot test that the overlap removal code is working,
    which operates by zeroing quality values.
    jkbonfield committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    62b7479 View commit details
    Browse the repository at this point in the history