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 setUnplaced() to the GATKRead api to distinguish reads with no mapping information #5320

Merged
merged 2 commits into from
Nov 20, 2018

Conversation

jamesemery
Copy link
Collaborator

Relates to my work on #4461

@jamesemery
Copy link
Collaborator Author

@lbergelson Can i get a review on this branch?

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 bunch of misc documentation change requests. I think it's sane though.

/**
* Reverse-complement bases and reverse quality scores along with known optional attributes that
* need the same treatment. Changes made after making a copy of the bases, qualities,
* and any attributes that will be altered. If in-place update is needed use
Copy link
Member

Choose a reason for hiding this comment

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

Maybe something like "Modify this read by reverse complementing its bases and reversing its quality scores. Implementations may also update tags that are known to need updating after the reverse complement operation."

Leave out the stuff about in place update.

@@ -469,6 +469,20 @@ default int numCigarElements(){
*/
void setIsUnmapped();

/**
* @return True if this read is unmapped, not including reads where the position is set but the read is marked as unmapped. Otherwise false.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe something like this would be slightly more clear?

Suggested change
* @return True if this read is unmapped, not including reads where the position is set but the read is marked as unmapped. Otherwise false.
* Does the read have a position assigned to it for sorting purposes.
* @return `true iff this read has no assigned position or contig.

/**
* @return True if this read's mate is unmapped, not including reads where the position is set but the read is marked as unmapped. Otherwise false.
*/
boolean mateIsUnplaced();
Copy link
Member

Choose a reason for hiding this comment

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

similar to above comments

Copy link
Member

Choose a reason for hiding this comment

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

provide a default implementation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately I can't provide a default implementation here because getContig() masks empty values. The whole point of this PR was to provide better access to the contig index and start position in samrecord beyond what getContig(), and getStart() currently provide.

Copy link
Member

Choose a reason for hiding this comment

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

you're right that there isn't a getMateAssignedContig. Should there be?

/**
* @return True if this read is unmapped, not including reads where the position is set but the read is marked as unmapped. Otherwise false.
*/
boolean isUnplaced();
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 provide a default implementation of this method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same response as above

Copy link
Member

Choose a reason for hiding this comment

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

can't a default implementation of this one use getAssignedContig?

boolean isUnplaced();

/**
* Mark the read as unmapped, and also removes mapping information from the read (i.e. sets contig to "*" and position to 0).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Mark the read as unmapped, and also removes mapping information from the read (i.e. sets contig to "*" and position to 0).
* Mark the read as unmapped, and also removes mapping information from the read (i.e. sets contig to {@link ReadConstants#UNSET_CONTIG} and position to {@link ReadConstants#UNSET_POSITION}).

* Calling this method has the additional effect of marking the read as paired, as if {@link #setIsPaired}
* were invoked with true.
*/
void setMateIsUnplaced();
Copy link
Member

Choose a reason for hiding this comment

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

similar to above comments

@jamesemery
Copy link
Collaborator Author

@lbergelson Resonded to your comments

@codecov-io
Copy link

Codecov Report

Merging #5320 into master will increase coverage by 0.296%.
The diff coverage is 91.25%.

@@              Coverage Diff               @@
##              master    #5320       +/-   ##
==============================================
+ Coverage     86.793%   87.09%   +0.296%     
- Complexity     30107    30493      +386     
==============================================
  Files           1842     1854       +12     
  Lines         139393   141474     +2081     
  Branches       15369    15530      +161     
==============================================
+ Hits          120984   123209     +2225     
+ Misses         12823    12618      -205     
- Partials        5586     5647       +61
Impacted Files Coverage Δ Complexity Δ
...broadinstitute/hellbender/utils/read/GATKRead.java 31.25% <ø> (ø) 7 <0> (ø) ⬇️
...ellbender/utils/read/GATKReadAdaptersUnitTest.java 96.813% <100%> (+0.276%) 102 <3> (+3) ⬆️
...lbender/utils/read/SAMRecordToGATKReadAdapter.java 91.606% <65%> (-2.095%) 144 <6> (+6)
...ls/funcotator/metadata/VcfFuncotationMetadata.java 71.429% <0%> (-28.571%) 8% <0%> (+3%)
...der/tools/HaplotypeCallerSparkIntegrationTest.java 58.73% <0%> (-3.035%) 12% <0%> (-1%)
...hellbender/tools/copynumber/GermlineCNVCaller.java 81.373% <0%> (-3.031%) 10% <0%> (ø)
...ools/copynumber/DetermineGermlineContigPloidy.java 91.209% <0%> (-2.839%) 15% <0%> (+1%)
...ender/tools/funcotator/FuncotationMapUnitTest.java 94.678% <0%> (-2.751%) 38% <0%> (-1%)
...ataSources/gencode/GencodeFuncotationUnitTest.java 97.183% <0%> (-1.335%) 8% <0%> (-4%)
...r/tools/walkers/mutect/Mutect2FilteringEngine.java 85.232% <0%> (-1.089%) 63% <0%> (+4%)
... and 78 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.

👍 Looks good. We could probably add a default implementation using getAssignedContig but it's fine if we don't...

@lbergelson lbergelson assigned jamesemery and unassigned lbergelson Nov 16, 2018
@lbergelson lbergelson merged commit 9acddab into master Nov 20, 2018
@lbergelson lbergelson deleted the je_addMethodsToGATKRead branch November 20, 2018 16:33
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