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 a distinction between PCR orientation and Optical Duplicates orientation in MarkDuplicatesSpark #4752

Merged
merged 2 commits into from
May 18, 2018

Conversation

jamesemery
Copy link
Collaborator

@jamesemery jamesemery commented May 9, 2018

Fixes #4730

Blocked by #4732

@codecov-io
Copy link

codecov-io commented May 14, 2018

Codecov Report

Merging #4752 into master will increase coverage by 0.05%.
The diff coverage is 93.333%.

@@              Coverage Diff               @@
##              master     #4752      +/-   ##
==============================================
+ Coverage     80.097%   80.147%   +0.05%     
- Complexity     17402     17558     +156     
==============================================
  Files           1080      1082       +2     
  Lines          63067     63387     +320     
  Branches       10174     10238      +64     
==============================================
+ Hits           50515     50803     +288     
- Misses          8566      8582      +16     
- Partials        3986      4002      +16
Impacted Files Coverage Δ Complexity Δ
...s/read/markduplicates/sparkrecords/PairedEnds.java 100% <ø> (ø) 1 <0> (ø) ⬇️
...transforms/markduplicates/MarkDuplicatesSpark.java 95.918% <ø> (ø) 16 <0> (ø) ⬇️
...ils/read/markduplicates/sparkrecords/Fragment.java 100% <100%> (ø) 11 <2> (+2) ⬆️
...r/utils/read/markduplicates/sparkrecords/Pair.java 96.667% <100%> (+3.333%) 29 <12> (+6) ⬆️
...ead/markduplicates/sparkrecords/EmptyFragment.java 88.889% <100%> (+0.654%) 9 <2> (+2) ⬆️
...forms/markduplicates/MarkDuplicatesSparkUtils.java 89.27% <75%> (-0.73%) 69 <2> (ø)
...utils/smithwaterman/SmithWatermanIntelAligner.java 50% <0%> (-30%) 1% <0%> (-2%)
...ellbender/utils/test/CommandLineProgramTester.java 91.667% <0%> (-3.571%) 11% <0%> (+2%)
...itute/hellbender/engine/spark/GATKRegistrator.java 100% <0%> (ø) 6% <0%> (+3%) ⬆️
...titute/hellbender/engine/TwoPassVariantWalker.java 95% <0%> (ø) 4% <0%> (?)
... and 5 more

…een orientation for optical duplicats and orientation for PCR duplicates
@jamesemery
Copy link
Collaborator Author

@lbergelson This is rebased on master and theoretically working representing that bugfix now when you get the chance to take a look.

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.

I have a few aesthetic comments, docs, and a request for an additional test.

(((long)((PairedEnds)record).getUnclippedStartPosition()) << 32 |
((PairedEnds)record).getFirstRefIndex() << 16 );
//| ((PairedEnds)pe).getLibraryIndex())).values();
((((long)((PairedEnds)record).getUnclippedStartPosition()) << 32) |
Copy link
Member

Choose a reason for hiding this comment

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

I would remove this redundant casting, by making the type of the record argument PairedEnds and then casting when you call instead of here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

if (R1R && R2R) {
return ReadEnds.RR;
}
if (R1R) {
return ReadEnds.RF; //at this point we know for sure R2R is false
return (optical&&wasFlipped)? ReadEnds.FR : ReadEnds.RF; //at this point we know for sure R2R is false
Copy link
Member

Choose a reason for hiding this comment

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

can we get some spaces here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}
if (R2R) {
return ReadEnds.FR; //at this point we know for sure R1R is false
return (optical&&wasFlipped)? ReadEnds.RF :ReadEnds.FR; //at this point we know for sure R1R is false
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}

@Override
public byte getPCROrientation() {
Copy link
Member

Choose a reason for hiding this comment

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

maybe rename to getOrientationForPCRDuplicates? It makes it sound like it's somehow the orientation of the PCR which doesn't mean anything to me.

Copy link
Member

Choose a reason for hiding this comment

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

This method should get some javadoc too explain why it's different than optical.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

public abstract int getScore();

public abstract boolean isR1R();
Copy link
Member

Choose a reason for hiding this comment

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

should we rename this? it's totally unintuitive, we could just expand to isRead1ReverseStrand which is still kind of nasty, but at least someone could figure it out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -171,14 +166,23 @@ public String toString() {
* Returns one of {@link ReadEnds#RR}, {@link ReadEnds#RF}, {@link ReadEnds#FR}, {@link ReadEnds#FF}
*/
public byte getOrientationForOpticalDuplicates() {
Copy link
Member

Choose a reason for hiding this comment

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

I think we want unit tests for these two methods that assert the truth table for the two different type of orientations

@lbergelson lbergelson assigned jamesemery and unassigned lbergelson May 17, 2018
@jamesemery
Copy link
Collaborator Author

@lbergelson Responded to your comments

@jamesemery jamesemery assigned lbergelson and unassigned jamesemery May 18, 2018
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.

👍

@lbergelson lbergelson merged commit 767b420 into master May 18, 2018
@lbergelson lbergelson deleted the je_MDOrientationWork branch May 18, 2018 18:42
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.

3 participants