Fix unmapped secondary alignments#592
Merged
Merged
Conversation
9c0b698 to
a574fb0
Compare
Owner
|
very good! |
These are ignored when comparing the outputs, but it allows us to test whether the BAM output is valid (according to picard ValidateSamFile).
Is-new-baseline: yes
a574fb0 to
fdd5d61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When secondary alignments are enabled, we currently handle unmapped reads incorrectly. So for example, if we have a pair where R1 can be mapped and has multiple mappings but R2 cannot be mapped, we output these SAM records:
I first changed it so that the second time R2 is output it is also marked as secondary, but then we have a SAM record that is both unmapped and secondary, which
picard ValidateSamFilerightfully complains about. The correct solution seems to be to just not output that last record, which is what this PR does.Also, we now let strobealign generate secondary alignments within the baseline comparison script. They are ignored when actually comparing the records to the baseline version, but this allows us to run
ValidateSamFileon a file with secondary alignments.The last commit changes the baseline commit because running strobealign with
-N 5and ignoring all secondary alignments does not give the same results as running it with-N 0.