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

GL-18 Funcotation filter for homvar & compound hets on two autosomal recessive genes #5843

Merged
merged 7 commits into from
Apr 2, 2019

Conversation

als364
Copy link
Contributor

@als364 als364 commented Mar 28, 2019

This PR adds a new filter for FilterFuncotations. For two autosomal recessive genes, MUTYH and ATP7B, homozygous variants and compound heterozygous variants will be tagged and added to the output vcf.

@codecov-io
Copy link

codecov-io commented Mar 28, 2019

Codecov Report

Merging #5843 into master will decrease coverage by 0.005%.
The diff coverage is 85.185%.

@@               Coverage Diff               @@
##              master     #5843       +/-   ##
===============================================
- Coverage     87.064%   87.058%   -0.005%     
- Complexity     32123     32206       +83     
===============================================
  Files           1977      1984        +7     
  Lines         147336    147583      +247     
  Branches       16199     16227       +28     
===============================================
+ Hits          128276    128483      +207     
- Misses         13154     13177       +23     
- Partials        5906      5923       +17
Impacted Files Coverage Δ Complexity Δ
...ator/filtrationRules/TwoPassFuncotationFilter.java 100% <100%> (ø) 1 <1> (?)
...er/tools/funcotator/filtrationRules/LmmFilter.java 100% <100%> (ø) 3 <1> (ø) ⬇️
...ellbender/tools/funcotator/FilterFuncotations.java 95.714% <100%> (+2.381%) 17 <9> (-1) ⬇️
...er/tools/funcotator/filtrationRules/LofFilter.java 100% <100%> (ø) 5 <2> (ø) ⬇️
.../funcotator/filtrationRules/FuncotationFilter.java 100% <100%> (ø) 8 <1> (ø) ⬇️
.../funcotator/FilterFuncotationsIntegrationTest.java 100% <100%> (ø) 5 <0> (ø) ⬇️
...ools/funcotator/filtrationRules/ClinVarFilter.java 100% <100%> (ø) 7 <1> (ø) ⬇️
...ncotator/filtrationRules/AlleleFrequencyUtils.java 87.5% <100%> (ø) 7 <2> (ø) ⬇️
...r/filtrationRules/AutosomalRecessiveConstants.java 50% <50%> (ø) 1 <1> (?)
...ols/funcotator/filtrationRules/ArHetvarFilter.java 73.333% <73.333%> (ø) 13 <13> (?)
... and 64 more

@droazen
Copy link
Contributor

droazen commented Mar 28, 2019

@als364 Can I request that you title your pull requests more descriptively? Ie., include the tool involved in the PR title, and a concise one-line description of the improvements/fixes. This would help when writing GATK release notes, as we use the PR titles as the basis for initial release notes. Thanks!

@als364
Copy link
Contributor Author

als364 commented Mar 29, 2019

Yes, can do.

@als364 als364 changed the title GL-18 AR filters GL-18 Funcotation filter for homvar & compound hets on two autosomal recessive genes Mar 29, 2019
@@ -213,10 +231,56 @@ private VariantContext applyFilters(final VariantContext variant, final Set<Stri
return variantContextBuilder.make();
}

private void buildArHetByGene(VariantContext variant) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in its own class?. Having AR specific code in the FilterFuncotations class seems like it breaks encapsulation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it could be. There's not currently a 'good' place for it as this can't be a FuncotationFilter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah - it may be worth designing another class hierarchy for filters that require two passes. That way the next time someone has to make a filter that requires work on the first pass it'll be easier.

Maybe as a subclass of FuncotationFilter?

Copy link
Collaborator

@jonn-smith jonn-smith left a comment

Choose a reason for hiding this comment

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

This looks pretty good.

I had a couple of comments - one about a refactor (similar to what @tlangs suggested), and a few others about some coding conventions we typically use for GATK tools.

@@ -213,10 +231,56 @@ private VariantContext applyFilters(final VariantContext variant, final Set<Stri
return variantContextBuilder.make();
}

private void buildArHetByGene(VariantContext variant) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah - it may be worth designing another class hierarchy for filters that require two passes. That way the next time someone has to make a filter that requires work on the first pass it'll be easier.

Maybe as a subclass of FuncotationFilter?

@jonn-smith jonn-smith assigned als364 and unassigned tlangs and jonn-smith Apr 1, 2019
@als364 als364 requested a review from jonn-smith April 1, 2019 19:57
Copy link
Collaborator

@jonn-smith jonn-smith 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!

Just a couple of comments. Once they're addressed and tests pass, feel free to merge.

import java.util.stream.Stream;

public class FilterFuncotationsUtils {
public static Stream<Set<Map.Entry<String, String>>> getTranscriptFuncotations(final FuncotationMap funcotationMap) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add Javadoc for this method?

}

private boolean arHetvarRule(Set<Map.Entry<String, String>> funcotations, VariantContext variant) {
return arCompoundHetVariants.stream().anyMatch(hetVariant -> variantContextsMatch(hetVariant, variant));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might want to add in a warning/error here (or in the parent class) if the firstPassApply and/or afterFirstPass was never called.

&& v1.getStart() == v2.getStart()
&& v1.getEnd() == v2.getEnd()
&& v1.getReference() == v2.getReference()
&& v1.getReference() == v2.getReference()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this line is a copy/paste error - was there something else you wanted to test between the variant contexts?

@als364 als364 merged commit 5da51e1 into master Apr 2, 2019
@als364 als364 deleted the as_GL-18_ar_filters branch April 2, 2019 19:56
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.

5 participants