VariantEvaluation implements Comparable<VariantEvaluation>, Filterable, Inheritable, Variant { public float getPathogenicityScore() { if (whiteListed) { return 1f; } float predictedScore = pathogenicityData.getScore(); float variantEffectScore = VariantEffectPathogenicityScore.getPathogenicityScoreOf(variantEffect); if (variantEffect == VariantEffect.MISSENSE_VARIANT) { return pathogenicityData.hasPredictedScore() ? predictedScore : variantEffectScore; } else { return Math.max(predictedScore, variantEffectScore); } } private  VariantEvaluation(Builder builder); @Override GenomeAssembly getGenomeAssembly(); @Override int getChromosome(); @Override String getChromosomeName(); @Override int getPosition(); @Override String getRef(); @Override String getAlt(); VariantContext getVariantContext(); int getAltAlleleId(); String getId(); double getPhredScore(); @Override VariantEffect getVariantEffect(); void setVariantEffect(VariantEffect ve); @Override String getGeneSymbol(); void setGeneSymbol(String symbol); @Override String getGeneId(); void setGeneId(String geneId); @Override List<TranscriptAnnotation> getTranscriptAnnotations(); void setAnnotations(List<TranscriptAnnotation> annotations); @Override boolean hasTranscriptAnnotations(); @JsonIgnore String getHgvsGenome(); @JsonIgnore String getGenotypeString(); Map<String, SampleGenotype> getSampleGenotypes(); SampleGenotype getSampleGenotype(String sampleId); @Override boolean addFilterResult(FilterResult filterResult); Set<FilterType> getPassedFilterTypes(); Set<FilterType> getFailedFilterTypes(); synchronized Set<FilterType> getFailedFilterTypesForMode(ModeOfInheritance modeOfInheritance); @Override synchronized boolean passedFilters(); @Override synchronized boolean passedFilter(FilterType filterType); FilterStatus getFilterStatus(); FilterStatus getFilterStatusForMode(ModeOfInheritance modeOfInheritance); float getVariantScore(); float getFrequencyScore(); float getPathogenicityScore(); boolean isPredictedPathogenic(); FrequencyData getFrequencyData(); void setFrequencyData(FrequencyData frequencyData); PathogenicityData getPathogenicityData(); void setPathogenicityData(PathogenicityData pathogenicityData); boolean isWhiteListed(); void setWhiteListed(boolean whiteListed); void setContributesToGeneScoreUnderMode(ModeOfInheritance modeOfInheritance); boolean contributesToGeneScore(); boolean contributesToGeneScoreUnderMode(ModeOfInheritance modeOfInheritance); @Override void setCompatibleInheritanceModes(Set<ModeOfInheritance> compatibleModes); @Override Set<ModeOfInheritance> getCompatibleInheritanceModes(); @Override boolean isCompatibleWith(ModeOfInheritance modeOfInheritance); @Override int compareTo(VariantEvaluation other); static int compareByRank(VariantEvaluation some, VariantEvaluation other); @Override int hashCode(); @Override boolean equals(Object obj); String toString(); static Builder builder(int chr, int pos, String ref, String alt);  }
@Test public void testGetPathogenicityScoreNonMissenseVariantNoPredictions() { VariantEffect type = VariantEffect.DOWNSTREAM_GENE_VARIANT; instance = testVariantBuilder().variantEffect(type).build(); float expected = VariantEffectPathogenicityScore.getPathogenicityScoreOf(type); assertThat(instance.getPathogenicityScore(), equalTo(expected)); }
@Test public void testGetPathogenicityScoreNonMissenseVariantWithPredictions() { VariantEffect type = VariantEffect.REGULATORY_REGION_VARIANT; PathogenicityData pathData = PathogenicityData.of(CaddScore.of(1f)); instance = testVariantBuilder().pathogenicityData(pathData).variantEffect(type).build(); assertThat(instance.getPathogenicityScore(), equalTo(pathData.getScore())); }
@Test public void testGetPathogenicityScoreMissenseVariantNoPredictions() { VariantEffect type = VariantEffect.MISSENSE_VARIANT; instance = testVariantBuilder().variantEffect(type).build(); float expected = VariantEffectPathogenicityScore.getPathogenicityScoreOf(type); assertThat(instance.getPathogenicityScore(), equalTo(expected)); }
@Test public void testGetPathogenicityScoreMissenseSiftPass() { PathogenicityData pathData = PathogenicityData.of(POLYPHEN_FAIL, MTASTER_FAIL, SIFT_PASS); VariantEffect type = VariantEffect.MISSENSE_VARIANT; instance = testVariantBuilder().pathogenicityData(pathData).variantEffect(type).build(); assertThat(instance.getPathogenicityScore(), equalTo(SIFT_PASS.getScore())); }
@Test public void testGetPathogenicityScoreMissensePolyPhenAndSiftPass() { PathogenicityData pathData = PathogenicityData.of(POLYPHEN_PASS, MTASTER_FAIL, SIFT_PASS); VariantEffect type = VariantEffect.MISSENSE_VARIANT; instance = testVariantBuilder().pathogenicityData(pathData).variantEffect(type).build(); assertThat(instance.getPathogenicityScore(), equalTo(SIFT_PASS.getScore())); }
@Test public void testGetPathogenicityScoreMissensePolyPhenSiftAndMutTasterPass() { PathogenicityData pathData = PathogenicityData.of(POLYPHEN_PASS, MTASTER_PASS, SIFT_PASS); VariantEffect type = VariantEffect.MISSENSE_VARIANT; instance = testVariantBuilder().pathogenicityData(pathData).variantEffect(type).build(); float expected = MTASTER_PASS.getScore(); assertThat(instance.getPathogenicityScore(), equalTo(expected)); }
@Test public void testGetPathogenicityScoreMissensePredictedScoreLessThanDefault() { float expected = 0.1f; assertThat(expected, lessThan(VariantEffectPathogenicityScore.DEFAULT_MISSENSE_SCORE)); PathogenicityData pathData = PathogenicityData.of(PolyPhenScore.of(expected)); VariantEvaluation instance = testVariantBuilder() .pathogenicityData(pathData) .variantEffect(VariantEffect.MISSENSE_VARIANT) .build(); assertThat(instance.getPathogenicityScore(), equalTo(expected)); }