InheritanceModeAnnotator { public Map<ModeOfInheritance, List<VariantEvaluation>> computeCompatibleInheritanceModes(List<VariantEvaluation> variantEvaluations) { List<GenotypeCalls> genotypeCalls = buildGenotypeCalls(variantEvaluations); try { Map<ModeOfInheritance, ImmutableList<GenotypeCalls>> compatibilityCalls = mendelChecker.checkMendelianInheritance(genotypeCalls); logger.debug("{}", compatibilityCalls); return variantsGroupedByCompatibleMode(compatibilityCalls); } catch (IncompatiblePedigreeException e) { logger.error("Problem with annotating VariantContext for Mendelian inheritance.", e); } return Collections.emptyMap(); } InheritanceModeAnnotator(Pedigree pedigree, InheritanceModeOptions inheritanceModeOptions); Pedigree getPedigree(); InheritanceModeOptions getInheritanceModeOptions(); Set<ModeOfInheritance> getDefinedModes(); Map<ModeOfInheritance, List<VariantEvaluation>> computeCompatibleInheritanceModes(List<VariantEvaluation> variantEvaluations); Map<SubModeOfInheritance, List<VariantEvaluation>> computeCompatibleInheritanceSubModes(List<VariantEvaluation> variantEvaluations);  }
@Test public void testAnalyseInheritanceModesEmptyInput() { Pedigree pedigree = singleAffectedSample("Nemo"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(Collections.emptyList()); assertThat(results, equalTo(Collections.emptyMap())); }
@Test public void testAutosomalDominantIndividual() { List<Allele> alleles = buildAlleles("A", "T"); Genotype genotype = buildPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(1)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, genotype); VariantEvaluation variant = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Adam"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalRecessiveIndividual() { List<Allele> alleles = buildAlleles("A", "T"); Genotype genotype = buildUnPhasedSampleGenotype("Adam", alleles.get(1), alleles.get(1)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, genotype); VariantEvaluation variant = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Adam"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_RECESSIVE, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testXDominantXRecessiveIndividual() { List<Allele> alleles = buildAlleles("A", "T"); Genotype genotype = buildPhasedSampleGenotype("Adam", alleles.get(1), alleles.get(1)); VariantContext variantContext = buildVariantContext(23, 12345, alleles, genotype); VariantEvaluation variant = filteredVariant(23, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Adam"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.X_DOMINANT, ImmutableList.of(variant), ModeOfInheritance.X_RECESSIVE, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testXDominantFamily() { List<Allele> alleles = buildAlleles("A", "T"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(0)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(1), alleles.get(0)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(1)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(0)); VariantContext variantContext = buildVariantContext(23, 12345, alleles, proband, brother, mother, father); VariantEvaluation variant = filteredVariant(23, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.AFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.X_DOMINANT, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testXRecessiveFamily() { List<Allele> alleles = buildAlleles("A", "T"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(1), alleles.get(0)); Genotype sister = buildUnPhasedSampleGenotype("Rachel", alleles.get(0), alleles.get(1)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(1)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(1)); VariantContext variantContext = buildVariantContext(23, 12345, alleles, proband, brother, sister, mother, father); VariantEvaluation variant = filteredVariant(23, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual sisterIndividual = Individual.builder().id("Rachel").fatherId("Adam").motherId("Eve").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.AFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual, sisterIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.X_RECESSIVE, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testMitochondrialIndividual() { List<Allele> alleles = buildAlleles("A", "T"); Genotype genotype = buildPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(1)); VariantContext variantContext = buildVariantContext(25, 12345, alleles, genotype); VariantEvaluation variant = filteredVariant(25, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Adam"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.MITOCHONDRIAL, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testMitochondrialFamily() { List<Allele> alleles = buildAlleles("A", "T"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(1), alleles.get(0)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(1)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(1), alleles.get(0)); VariantContext variantContext = buildVariantContext(25, 12345, alleles, proband, brother, mother, father); VariantEvaluation variant = filteredVariant(25, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.AFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(variant)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.MITOCHONDRIAL, ImmutableList.of(variant) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalRecessiveFamilyOneAlt() { List<Allele> alleles = buildAlleles("A", "T"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(0), alleles.get(1)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(1)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(1), alleles.get(0)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband, brother, mother, father); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_RECESSIVE, ImmutableList.of(alleleOne) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalRecessiveFamilyTwoAlts() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(1), alleles.get(2)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(1)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(1), alleles.get(0)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband, brother, mother, father); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_RECESSIVE, ImmutableList.of(alleleOne, alleleTwo) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalDominantFamilyOneAlt() { List<Allele> alleles = buildAlleles("A", "T"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(0), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(0), alleles.get(0)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(0)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(0)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband, brother, mother, father); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleOne) ); assertThat(results, equalTo(expected)); }
@Disabled @Test public void testAutosomalDominantFamilyTwoAlts() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(0), alleles.get(1)); Genotype brother = buildUnPhasedSampleGenotype("Abel", alleles.get(2), alleles.get(2)); Genotype mother = buildUnPhasedSampleGenotype("Eve", alleles.get(0), alleles.get(2)); Genotype father = buildUnPhasedSampleGenotype("Adam", alleles.get(0), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband, brother, mother, father); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Individual probandIndividual = Individual.builder().id("Cain").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.AFFECTED).build(); Individual brotherIndividual = Individual.builder().id("Abel").fatherId("Adam").motherId("Eve").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Individual motherIndividual = Individual.builder().id("Eve").fatherId("").motherId("").sex(Sex.FEMALE).status(Status.UNAFFECTED).build(); Individual fatherIndividual = Individual.builder().id("Adam").fatherId("").motherId("").sex(Sex.MALE).status(Status.UNAFFECTED).build(); Pedigree pedigree = Pedigree.of(probandIndividual, motherIndividual, fatherIndividual, brotherIndividual); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleOne) ); assertThat(results, equalTo(expected)); }
@Test public void testCompHetAutosomalRecessiveIndividual() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Cain"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleOne, alleleTwo), ModeOfInheritance.AUTOSOMAL_RECESSIVE, ImmutableList.of(alleleOne, alleleTwo) ); assertThat(results, equalTo(expected)); }
@Test public void testCompHetAutosomalRecessiveIndividualWithFrequencyThreshold() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildUnPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); alleleOne.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.LOCAL, 1f))); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); alleleTwo.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.LOCAL, 1f))); Pedigree pedigree = singleAffectedSample("Cain"); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, InheritanceModeOptions.defaults()); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_RECESSIVE, ImmutableList.of(alleleOne, alleleTwo) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalDominantHetAltIndividualWithModeOfInheritanceFrequencies() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); float alleleOneMaxFreq = 1.0f; alleleOne.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.LOCAL, alleleOneMaxFreq))); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Cain"); ImmutableMap<SubModeOfInheritance, Float> maxMafMap = ImmutableMap.of( SubModeOfInheritance.AUTOSOMAL_DOMINANT, alleleOneMaxFreq - 0.1f ); InheritanceModeOptions inheritanceModeOptions = InheritanceModeOptions.of(maxMafMap); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, inheritanceModeOptions); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleTwo) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalDominantHetAltIndividualWithModeOfInheritanceAnyFrequencies() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); float alleleOneMaxFreq = 1.0f; alleleOne.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.LOCAL, alleleOneMaxFreq))); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); Pedigree pedigree = singleAffectedSample("Cain"); ImmutableMap<SubModeOfInheritance, Float> maxMafMap = ImmutableMap.of( SubModeOfInheritance.ANY, 2.0f, SubModeOfInheritance.AUTOSOMAL_DOMINANT, alleleOneMaxFreq - 0.1f ); InheritanceModeOptions inheritanceModeOptions = InheritanceModeOptions.of(maxMafMap); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, inheritanceModeOptions); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.ANY, ImmutableList.of(alleleOne, alleleTwo), ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleTwo) ); assertThat(results, equalTo(expected)); }
@Test public void testAutosomalDominantHetAltIndividualWithModeOfInheritanceAnyFrequenciesWhitelistedVariantOverFrequencyCutoff() { List<Allele> alleles = buildAlleles("A", "T", "C"); Genotype proband = buildPhasedSampleGenotype("Cain", alleles.get(1), alleles.get(2)); VariantContext variantContext = buildVariantContext(1, 12345, alleles, proband); VariantEvaluation alleleOne = filteredVariant(1, 12345, "A", "T", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); float alleleOneMaxFreq = 1.0f; alleleOne.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.LOCAL, alleleOneMaxFreq))); VariantEvaluation alleleTwo = filteredVariant(1, 12345, "A", "C", FilterResult.pass(FilterType.FREQUENCY_FILTER), variantContext); alleleTwo.setFrequencyData(FrequencyData.of(Frequency.of(FrequencySource.GNOMAD_E_AMR, 5f))); alleleTwo.setWhiteListed(true); Pedigree pedigree = singleAffectedSample("Cain"); ImmutableMap<SubModeOfInheritance, Float> maxMafMap = ImmutableMap.of( SubModeOfInheritance.ANY, 2.0f, SubModeOfInheritance.AUTOSOMAL_DOMINANT, alleleOneMaxFreq - 0.1f ); InheritanceModeOptions inheritanceModeOptions = InheritanceModeOptions.of(maxMafMap); InheritanceModeAnnotator instance = new InheritanceModeAnnotator(pedigree, inheritanceModeOptions); Map<ModeOfInheritance, List<VariantEvaluation>> results = instance.computeCompatibleInheritanceModes(ImmutableList.of(alleleOne, alleleTwo)); Map<ModeOfInheritance, List<VariantEvaluation>> expected = ImmutableMap.of( ModeOfInheritance.ANY, ImmutableList.of(alleleOne, alleleTwo), ModeOfInheritance.AUTOSOMAL_DOMINANT, ImmutableList.of(alleleTwo) ); assertThat(results, equalTo(expected)); }