VariantEvidenceAnalyzer { @NotNull public List<EvidenceItem> evidenceForVariant(@NotNull Variant variant, @Nullable String primaryTumorLocation, @NotNull CancerTypeAnalyzer cancerTypeAnalyzer) { List<EvidenceItem> evidenceItems = Lists.newArrayList(); for (ActionableVariant actionableVariant : actionableVariants) { if (variant.gene().equals(actionableVariant.gene()) && variant.chromosome().equals(actionableVariant.chromosome()) && variant.position() == actionableVariant.position() && variant.ref().equals(actionableVariant.ref()) && variant.alt() .equals(actionableVariant.alt())) { ImmutableEvidenceItem.Builder evidenceBuilder = fromActionableVariant(actionableVariant); evidenceBuilder.event(eventString(variant)); evidenceBuilder.isOnLabel(cancerTypeAnalyzer.isCancerTypeMatch(actionableVariant.cancerType(), primaryTumorLocation)); evidenceItems.add(evidenceBuilder.build()); } } for (ActionableRange actionableRange : actionableRanges) { if (CODING_EFFECTS.contains(variant.canonicalCodingEffect()) && variant.gene().equals(actionableRange.gene()) && variant.chromosome().equals(actionableRange.chromosome()) && variant.position() >= actionableRange.start() && variant.position() <= actionableRange.end()) { ImmutableEvidenceItem.Builder evidenceBuilder = fromActionableRange(actionableRange); evidenceBuilder.event(eventString(variant)); evidenceBuilder.isOnLabel(cancerTypeAnalyzer.isCancerTypeMatch(actionableRange.cancerType(), primaryTumorLocation)); evidenceItems.add(evidenceBuilder.build()); } } return evidenceItems; } VariantEvidenceAnalyzer(@NotNull final List<ActionableVariant> actionableVariants,
            @NotNull List<ActionableRange> actionableRanges); @NotNull Set<String> actionableGenes(); @NotNull List<ActionableVariant> actionableVariants(); @NotNull List<ActionableRange> actionableRanges(); @NotNull List<EvidenceItem> evidenceForVariant(@NotNull Variant variant, @Nullable String primaryTumorLocation,
            @NotNull CancerTypeAnalyzer cancerTypeAnalyzer);  }
@Test public void actionabilityWorksVariants() { ActionableVariant actionableVariant = ImmutableActionableVariant.builder() .gene("BRAF") .chromosome("X") .position(1234) .ref("C") .alt("T") .source("civic") .reference("BRAF 600E") .drug("Dabrafenib") .drugsType("BRAF inhibitor") .cancerType("Skin Melanoma") .level("A") .response("Responsive") .build(); ActionableRange actionableRange = ImmutableActionableRange.builder() .gene("BRAF") .chromosome("7") .start(10) .end(1500) .source("oncoKB") .reference("BRAF Oncogenic Mutations") .drug("Cetuximab") .drugsType("EGFR mAb inhibitor") .cancerType("Skin Melanoma") .level("A") .response("Resistant") .build(); VariantEvidenceAnalyzer analyzer = new VariantEvidenceAnalyzer(Lists.newArrayList(actionableVariant), Lists.newArrayList(actionableRange)); CancerTypeAnalyzer cancerTypeAnalyzer = CancerTypeAnalyzerTestFactory.buildWithOneCancerTypeMapping("Skin Melanoma", "4159"); SomaticVariant variantWithNoCodingEffect = createSomaticvariant() .gene("BRAF") .chromosome("7") .position(100) .canonicalCodingEffect(CodingEffect.NONE) .canonicalHgvsCodingImpact(Strings.EMPTY) .canonicalHgvsProteinImpact(Strings.EMPTY) .build(); assertEquals(0, analyzer.evidenceForVariant(variantWithNoCodingEffect, "Skin", cancerTypeAnalyzer).size()); SomaticVariant variantWithCodingEffect = createSomaticvariant() .gene("BRAF") .chromosome("7") .position(100) .canonicalCodingEffect(CodingEffect.MISSENSE) .canonicalHgvsCodingImpact(Strings.EMPTY) .canonicalHgvsProteinImpact(Strings.EMPTY) .build(); assertEquals(1, analyzer.evidenceForVariant(variantWithCodingEffect, "Skin", cancerTypeAnalyzer).size()); }
@Test public void actionabilityWorksVariants() { ActionableVariant actionableVariant = ImmutableActionableVariant.builder() .gene("BRAF") .chromosome("X") .position(1234) .ref("C") .alt("T") .source("civic") .reference("BRAF 600E") .drug("Dabrafenib") .drugsType("BRAF inhibitor") .cancerType("Skin Melanoma") .level("A") .response("Responsive") .build(); ActionableRange actionableRange = ImmutableActionableRange.builder() .gene("BRAF") .chromosome("7") .start(10) .end(1500) .source("oncoKB") .reference("BRAF Oncogenic Mutations") .drug("Cetuximab") .drugsType("EGFR mAb inhibitor") .cancerType("Skin Melanoma") .level("A") .response("Resistant") .build(); VariantEvidenceAnalyzer analyzer = new VariantEvidenceAnalyzer(Lists.newArrayList(actionableVariant), Lists.newArrayList(actionableRange)); CancerTypeAnalyzer cancerTypeAnalyzer = CancerTypeAnalyzerTestFactory.buildWithOneCancerTypeMapping("Skin Melanoma", "4159"); SomaticVariant variantWithNoCodingEffect = SomaticVariantTestBuilderFactory.create() .gene("BRAF") .chromosome("7") .position(100) .canonicalCodingEffect(CodingEffect.NONE) .canonicalHgvsCodingImpact(Strings.EMPTY) .canonicalHgvsProteinImpact(Strings.EMPTY) .build(); assertEquals(0, analyzer.evidenceForVariant(variantWithNoCodingEffect, "Skin", cancerTypeAnalyzer).size()); SomaticVariant variantWithCodingEffect = SomaticVariantTestBuilderFactory.create() .gene("BRAF") .chromosome("7") .position(100) .canonicalCodingEffect(CodingEffect.MISSENSE) .canonicalHgvsCodingImpact(Strings.EMPTY) .canonicalHgvsProteinImpact(Strings.EMPTY) .build(); assertEquals(1, analyzer.evidenceForVariant(variantWithCodingEffect, "Skin", cancerTypeAnalyzer).size()); }