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

Fixes edge case where soft-cliped portion of a read ends up at a nega… #1513

Merged
merged 6 commits into from
May 21, 2020

Conversation

fleharty
Copy link
Contributor

…tive position

Description

Give your PR a concise yet descriptive title
Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?
Mention any issues fixed, addressed or otherwise related to this pull request, including issue numbers or hard links for issues in other repos.
You can delete these instructions once you have written your PR description.


Checklist (never delete this)

Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.

Content

  • Added or modified tests to cover changes and any new functionality
  • Edited the README / documentation (if applicable)
  • All tests passing on Travis

Review

  • Final thumbs-up from reviewer
  • Rebase, squash and reword as applicable

For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests

@fleharty
Copy link
Contributor Author

Made this initial PR, waiting on tests to pass and a larger test on a full sized bam to complete.

@fleharty
Copy link
Contributor Author

@yfarjoun We found an annoying edge case. Assuming this passes tests, could you take a look at this?

@gbggrant gbggrant requested a review from yfarjoun May 21, 2020 18:14
Copy link
Contributor

@yfarjoun yfarjoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we talked offline about making this better with a different one-line change...

@@ -819,10 +819,10 @@ private static int getReadPositionAtReferencePositionIgnoreSoftClips(final SAMRe

// Temporarily use the newCigar that has SOFT_CLIPs replaced with MATCH_OR_MISMATCH to get read position at reference, but ignore existence of soft-clips
rec.setCigar(newCigar);
readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos, false);
readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos + posShift, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment that since the read effectively got shifted forward by turning the clips into matches, the query position needs also to be moved forward so that it's still querying the same base

Copy link
Contributor

@yfarjoun yfarjoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch.

thanks for the tests.

thumbs up after adding a comment.

@fleharty fleharty merged commit dfc76d5 into master May 21, 2020
@fleharty fleharty deleted the mf_hard_clip_edge_case branch April 3, 2022 15:13
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.

2 participants