RemmDao implements PathogenicityDao { @Caching(cacheable = { @Cacheable(cacheNames = "hg19.remm", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG19"), @Cacheable(cacheNames = "hg38.remm", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG38"), }) @Override public PathogenicityData getPathogenicityData(Variant variant) { logger.debug("Getting REMM data for {}", variant); if (variant.getVariantEffect() == VariantEffect.MISSENSE_VARIANT) { return PathogenicityData.empty(); } return processResults(variant); } RemmDao(TabixDataSource remmTabixDataSource); @Caching(cacheable = { @Cacheable(cacheNames = "hg19.remm", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG19"), @Cacheable(cacheNames = "hg38.remm", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG38"), }) @Override PathogenicityData getPathogenicityData(Variant variant);  }
@Test public void testGetPathogenicityDataMissenseVariant() { VariantEvaluation missenseVariant = VariantEvaluation.builder(1, 1, "A", "T") .variantEffect(VariantEffect.MISSENSE_VARIANT) .build(); assertThat(instance.getPathogenicityData(missenseVariant), equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataSingleNucleotideVariationNoData() { Mockito.when(remmTabixReader.query("1:1-1")).thenReturn(MockTabixIterator.empty()); assertThat(instance.getPathogenicityData(variant(1, 1, "A", "T")), equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataSingleNucleotideVariation() { Mockito.when(remmTabixReader.query("1:1-1")).thenReturn(MockTabixIterator.of("1\t1\t1.0")); assertThat(instance.getPathogenicityData(variant(1, 1, "A", "T")), equalTo(PathogenicityData.of(RemmScore.of(1f)))); }
@Test public void testGetPathogenicityDataInsertion() { Mockito.when(remmTabixReader.query("1:1-2")).thenReturn(MockTabixIterator.of("1\t1\t0.0", "1\t2\t1.0")); assertThat(instance.getPathogenicityData(variant(1, 1, "A", "ATTT")), equalTo(PathogenicityData.of(RemmScore.of(1f)))); }
@Test public void testGetPathogenicityDataDeletion() { MockTabixIterator mockIterator = MockTabixIterator.of("1\t1\t0.0", "1\t2\t0.5", "1\t3\t1.0", "1\t4\t0.0"); Mockito.when(remmTabixReader.query("1:1-4")).thenReturn(mockIterator); assertThat(instance.getPathogenicityData(variant(1, 1, "ATTT", "A")), equalTo(PathogenicityData.of(RemmScore.of(1f)))); }