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

Fixed bug where SamPairUtil.setMateInfo() would omit the MQ tag if on… #647

Merged
merged 1 commit into from
Jun 28, 2016

Conversation

tfenne
Copy link
Member

@tfenne tfenne commented Jun 23, 2016

Description

Fix a small but annoying bug that was causing unmapped reads with mapped mates to get most mate information set except MQ which is set in all other cases.

Checklist

  • Code compiles correctly
  • New tests covering changes and new functionality
  • All tests passing
  • Extended the README / documentation, if necessary
  • Is not backward compatible (breaks binary or source compatibility)

…e read was mapped and the other unmapped.

@tfenne
Copy link
Member Author

tfenne commented Jun 23, 2016

@ktibbett Want to take a quick look at this? This will effect FixMateInformation and MergeBamAlignment results, but in a good way.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 68.407% when pulling 3ec1736 on tf_fix_set_mate_info into 2e26fe8 on master.

@@ -246,12 +246,14 @@ else if (rec1.getReadUnmappedFlag() && rec2.getReadUnmappedFlag()) {
mapped.setMateUnmappedFlag(true);
// For the mapped read, set it's mateCigar to null, since the other read must be unmapped
mapped.setAttribute(SAMTag.MC.name(), null);
mapped.setAttribute(SAMTag.MQ.name(), null);
Copy link
Member

Choose a reason for hiding this comment

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

move to before setting the MC since that's the order elsewhere: it makes it easier to find.

@tfenne
Copy link
Member Author

tfenne commented Jun 27, 2016

@yfarjoun Want to return the favor and take a look here since @ktibbett seems busy?

mapped.setInferredInsertSize(0);

unmapped.setMateReferenceIndex(mapped.getReferenceIndex());
unmapped.setMateAlignmentStart(mapped.getAlignmentStart());
unmapped.setMateNegativeStrandFlag(mapped.getReadNegativeStrandFlag());
unmapped.setMateUnmappedFlag(false);
unmapped.setAttribute(SAMTag.MQ.name(), mapped.getMappingQuality());
// For the unmapped read, set it's mateCigar to the mate's Cigar, since the mate must be mapped
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it was like that before...can you remove the ' from "it's"

@yfarjoun
Copy link
Contributor

👍 though I protest that this class lacks tests...we should at least open a ticket to record this fact...

@tfenne
Copy link
Member Author

tfenne commented Jun 28, 2016

Updates applied. @yfarjoun If we logged issues for everything that needed testing... we'd have a lot of issues 😞 .

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 68.405% when pulling 4b22d5d on tf_fix_set_mate_info into 7084c88 on master.

@yfarjoun
Copy link
Contributor

👍

@tfenne tfenne merged commit d683012 into master Jun 28, 2016
@tfenne tfenne deleted the tf_fix_set_mate_info branch June 28, 2016 15:46
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.

4 participants