@Test
public void prioritisedGeneWithKnownDiseaseCurrentInheritanceNotMatchesDiseaseWithUnknownGeneInheritance() {

    // Here we have a gene with a possible dominant or compound het compatible set of variants
    Gene gene = newGeneCompatibleWith(ModeOfInheritance.AUTOSOMAL_DOMINANT, ModeOfInheritance.AUTOSOMAL_RECESSIVE);
    addHiPhiveResultWithScore(gene, PHENOTYPE_SCORE);
    // This simulates frequent cases where there is an OMIM and Orphanet entry for the same disorder, but Orphanet
    // does not indicate an inheritance mode.
    InheritanceMode[] inheritanceModes = {InheritanceMode.AUTOSOMAL_RECESSIVE, InheritanceMode.UNKNOWN};
    Map<ModeOfInheritance, Double> scores = new EnumMap<>(ModeOfInheritance.class);
    scores.put(ModeOfInheritance.AUTOSOMAL_DOMINANT, 0.5); //does not match disease inheritance pattern
    scores.put(ModeOfInheritance.AUTOSOMAL_RECESSIVE, 1.0); //matches known disease and gene inheritance patterns
    scores.put(ModeOfInheritance.X_RECESSIVE, 0.5);
    scores.put(ModeOfInheritance.X_DOMINANT, 0.5);
    scores.put(ModeOfInheritance.MITOCHONDRIAL, 0.5);
    addOmimResultToGene(gene, scores, inheritanceModes);
    // Under AD the known associated diseases are incompatible so the score should be reduced
    double adScore = instance.calculateGenePriorityScoreForMode(gene, ModeOfInheritance.AUTOSOMAL_DOMINANT);
    assertThat(adScore, equalTo(0.5 * PHENOTYPE_SCORE));
    // Under AR all modes are compatible so we expect the full phenotype score
    double arScore = instance.calculateGenePriorityScoreForMode(gene, ModeOfInheritance.AUTOSOMAL_RECESSIVE);
    assertThat(arScore, equalTo(PHENOTYPE_SCORE));
}