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

Added alignment type to RecordAndOffset class #1411

Merged
merged 2 commits into from
Aug 21, 2019
Merged

Added alignment type to RecordAndOffset class #1411

merged 2 commits into from
Aug 21, 2019

Conversation

michaelgatzen
Copy link
Contributor

@michaelgatzen michaelgatzen commented Aug 21, 2019

Description

Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?

Things to think about before submitting:

  • Make sure your changes compile and new tests pass locally.
  • Add new tests or update existing ones:
    • A bug fix should include a test that previously would have failed and passes now.
    • New features should come with new tests that exercise and validate the new functionality.
  • Extended the README / documentation, if necessary
  • Check your code style.
  • Write a clear commit title and message
    • The commit message should describe what changed and is targeted at htsjdk developers
    • Breaking changes should be mentioned in the commit message.

- as requested per Picard pull request #1370
- necessary to determine whether a RecordAndOffset object is an
(alignment) match, insertion, or deletion when queried by a
SamLocusIterator
- default behavior is preserved by overloading the default constructor
Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

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

@michaelgatzen The code looks good to me. Could you add a test in SamLocusIterator that shows that this information is correctly associated with insertions / deletions? You might be able to just add an extra assertion to existing tests for insertion/deletion functionality. Even though this is pretty simple, it's good to have a defensive check in case someone breaks it accidentally in the future.

Also, as an aside, if you include an issue number for another repository in the commit / github messages you should use a full link rather than a number, because github will erroneously link a simple issue number to the htsjdk issue if you don't.

@michaelgatzen
Copy link
Contributor Author

@lbergelson Agreed, I added lots of asserts in SamLocusIteratorTest. Also changed the description of the PR.

@@ -582,6 +658,10 @@ public void testOverlappingGappedAlignmentsWithoutIndels() {
Assert.assertEquals(li.size(), expectedDepths[i]);
Assert.assertEquals(li.getPosition(), expectedReferencePositions[i]);
Assert.assertEquals(li.getRecordAndOffsets().size(), expectedReadOffsets[i].length);
// Check the correct assignment of the alignment type
for (final SamLocusIterator.RecordAndOffset rao : li.getRecordAndOffsets()) {
Copy link
Member

Choose a reason for hiding this comment

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

This is all a bit redundant, but it just seems like these tests have a ton of redundant code. We can clean that up separately.

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

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

👍 Thank you for adding tests.

@lbergelson lbergelson merged commit 9628c1e into samtools:master Aug 21, 2019
@lbergelson
Copy link
Member

@michaelgatzen Thank you and congrats on your first htsjdk pr :)

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