CaddDao implements PathogenicityDao { @Caching(cacheable = { @Cacheable(cacheNames = "hg19.cadd", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG19"), @Cacheable(cacheNames = "hg38.cadd", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG38"), }) @Override public PathogenicityData getPathogenicityData(Variant variant) { logger.debug("Getting CADD data for {}", variant); return processResults(variant); } CaddDao(TabixDataSource caddInDelTabixDataSource, TabixDataSource caddSnvTabixDataSource); @Caching(cacheable = { @Cacheable(cacheNames = "hg19.cadd", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG19"), @Cacheable(cacheNames = "hg38.cadd", keyGenerator = "variantKeyGenerator", condition = "#variant.genomeAssembly == T(org.monarchinitiative.exomiser.core.genome.GenomeAssembly).HG38"), }) @Override PathogenicityData getPathogenicityData(Variant variant);  }
@Test public void testGetPathogenicityDataSnvNoData() { Mockito.when(snvTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.empty()); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "T")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataInsertionNoData() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.empty()); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "C", "CA")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataInsertionSingleVariantAtPositionNoMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "1\t1\tA\tAT\t-0.234\t3.45", "1\t1\tA\tAC\t-0.234\t4.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "AG")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataInsertionSingleVariantAtPositionOneMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of("1\t2\tA\tAA\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "AA")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDataInsertionMultipleVariantsAtPositionOneMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "\t\tA\tAC\t-0.234\t4.45", "\t\tA\tAT\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "AT")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDatadeletionNoData() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.empty()); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "AT", "T")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDatadeletionSingleVariantAtPositionNoMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "1\t1\tAT\tA\t-0.234\t3.45", "1\t1\tAC\tA\t-0.234\t4.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "AG", "A")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataDeletionSingleVariantAtPositionOneMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of("1\t2\tGT\tG\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "GT", "G")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDataDeletionMultipleVariantsAtPositionOneMatch() { Mockito.when(indelTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "\t\tAC\tA\t-0.234\t4.45", "\t\tAT\tA\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "AC", "A")); assertPathDataContainsCaddScore(result, 4.45f); }
@Test public void testGetPathogenicityDataSnvSingleVariantAtPositionNoMatch() { Mockito.when(snvTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "1\t1\tA\tT\t-0.234\t3.45", "1\t1\tA\tC\t-0.234\t4.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "G")); assertThat(result, equalTo(PathogenicityData.empty())); }
@Test public void testGetPathogenicityDataSnvSingleVariantAtPositionOneMatch() { Mockito.when(snvTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of("1\t1\tA\tT\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "T")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDataSnvXchrSingleVariantAtPositionOneMatch() { Mockito.when(snvTabixReader.query("X:1-1")).thenReturn(MockTabixIterator.of("1\t1\tA\tT\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(23, 1, "A", "T")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDataSnvYchrSingleVariantAtPositionOneMatch() { Mockito.when(snvTabixReader.query("Y:1-1")).thenReturn(MockTabixIterator.of("1\t1\tA\tT\t-0.234\t3.45")); PathogenicityData result = instance.getPathogenicityData(variant(24, 1, "A", "T")); assertPathDataContainsCaddScore(result, 3.45f); }
@Test public void testGetPathogenicityDataSnvMultipleVariantsAtPositionOneMatch() { Mockito.when(snvTabixReader.query("1:2-2")).thenReturn(MockTabixIterator.of( "\t\tA\tT\t-0.234\t3.45", "\t\tA\tC\t-0.234\t4.45")); PathogenicityData result = instance.getPathogenicityData(variant(1, 2, "A", "T")); assertPathDataContainsCaddScore(result, 3.45f); }