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 a missing special case in MarkDuplicates ReadsKey code #4899

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

jamesemery
Copy link
Collaborator

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 15, 2018

Codecov Report

Merging #4899 into master will increase coverage by 0.178%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##              master     #4899       +/-   ##
===============================================
+ Coverage     80.453%   80.631%   +0.178%     
- Complexity     17837     18309      +472     
===============================================
  Files           1092      1092               
  Lines          64231     65642     +1411     
  Branches       10348     10735      +387     
===============================================
+ Hits           51676     52928     +1252     
- Misses          8504      8601       +97     
- Partials        4051      4113       +62
Impacted Files Coverage Δ Complexity Δ
...r/utils/read/markduplicates/sparkrecords/Pair.java 97.561% <100%> (+0.264%) 27 <0> (ø) ⬇️
...e/hellbender/tools/funcotator/FuncotatorUtils.java 80.176% <0%> (-0.154%) 231% <0%> (+63%)
...forms/markduplicates/MarkDuplicatesSparkUtils.java 90.995% <0%> (+0.474%) 63% <0%> (ø) ⬇️
...dataSources/gencode/GencodeFuncotationBuilder.java 97.5% <0%> (+0.726%) 57% <0%> (+27%) ⬆️
.../tools/funcotator/mafOutput/MafOutputRenderer.java 96.471% <0%> (+0.795%) 64% <0%> (+11%) ⬆️
...dataSources/gencode/GencodeFuncotationFactory.java 85.495% <0%> (+1.862%) 310% <0%> (+146%) ⬆️
...tools/funcotator/dataSources/TableFuncotation.java 73.636% <0%> (+2.669%) 44% <0%> (+15%) ⬆️
...titute/hellbender/tools/funcotator/Funcotator.java 88.259% <0%> (+2.733%) 70% <0%> (+28%) ⬆️
...te/hellbender/tools/funcotator/FuncotationMap.java 87.129% <0%> (+2.918%) 34% <0%> (+6%) ⬆️
.../tools/funcotator/vcfOutput/VcfOutputRenderer.java 88.75% <0%> (+3.036%) 17% <0%> (+1%) ⬆️
... and 5 more

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.

@jamesemery A few comments.

int read1ReferenceIndex = ReadUtils.getReferenceIndex(read1,header);
int read2ReferenceIndex = ReadUtils.getReferenceIndex(read2,header);

if( read1ReferenceIndex != read2ReferenceIndex ? read1ReferenceIndex < read2ReferenceIndex : read1UnclippedStart <= read2UnclippedStart ){
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this would be easier to read as

if( read1ReferenceIndex <= read2ReferenceIndex && read1UnclippedStart <= read2UnclippedStart) {

unless I missed something there that makes them not equivalent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No actually that is not equivalent, if read2RefIndex > read1RefIndex BUT it starts earlier on its contig that statement would be false when it should not be

Copy link
Member

Choose a reason for hiding this comment

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

Oh, heh, you're write. I didn't think that through.

isRead1ReverseStrand = first.isReverseStrand();
isRead2ReverseStrand = second.isReverseStrand();

// Keep track of the orientation of read1 and read2 as it is important for optical duplicate marking
wasFlipped = second.isFirstOfPair(); //TODO be sure this is still correct...
Copy link
Member

Choose a reason for hiding this comment

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

todo worries me

firstStartPosition = first.getAssignedStart();

// Ensuring that the orientation is consistent for reads starting at the same place there is no propper order
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 the comment in picard is clearer

Copy link
Member

Choose a reason for hiding this comment

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

// if the two read ends are in the same position, pointing in opposite directions,
// the orientation is undefined and the procedure above
// will depend on the order of the reads in the file.
// To avoid this, we set it explicitly (to FR):

Copy link
Member

Choose a reason for hiding this comment

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

also, propper -> proper

int read1ReferenceIndex = ReadUtils.getReferenceIndex(read1,header);
int read2ReferenceIndex = ReadUtils.getReferenceIndex(read2,header);

if( read1ReferenceIndex != read2ReferenceIndex ? read1ReferenceIndex < read2ReferenceIndex : read1UnclippedStart <= read2UnclippedStart ){
Copy link
Member

Choose a reason for hiding this comment

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

There should be a test for this edge case that we were missing.

@jamesemery
Copy link
Collaborator Author

@lbergelson back to you

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.

👍

@jamesemery jamesemery merged commit c97c7de into master Jun 18, 2018
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