VariantHotspotEvidenceFactory { @VisibleForTesting static boolean isVariantPartOfLargerMNV(int start, @NotNull final String refSequence, @NotNull final VariantHotspot hotspot, @NotNull final SAMRecord record) { int mvnLength = Math.max(hotspot.ref().length(), hotspot.alt().length()); int hotspotStartPosition = (int) hotspot.position(); int hotspotEndPosition = (int) hotspot.position() + mvnLength - 1; int requiredBuffer = hotspotStartPosition - start; if (requiredBuffer == 0) { return false; } return isStartPartOfLargerMNV(start, record, refSequence.substring(0, requiredBuffer)) || isEndPartOfLargerMNV( hotspotEndPosition + 1, record, refSequence.substring(requiredBuffer + mvnLength)); } VariantHotspotEvidenceFactory(int minMappingQuality, int minBaseQuality, @NotNull final Set<VariantHotspot> hotspots); @NotNull List<VariantHotspotEvidence> evidence(@NotNull final IndexedFastaSequenceFile sequenceFile, @NotNull final SamReader samReader);  }
@Test public void testIsPartOfLargerMNV() { assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "GATACAA"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "GACATAA"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(97, "7M", "AGATACAAA"))); assertFalse(isVariantPartOfLargerMNV(99, "ATACA", MNV, buildSamRecord(98, "7M", "TATACAG"))); assertFalse(isVariantPartOfLargerMNV(99, "ATACA", MNV, buildSamRecord(98, "7M", "TATACAG"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "1M1D5M", "TTACAA"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "2M1I5M", "GGGTACAA"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "5M1I2M", "GATACCCC"))); assertFalse(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "5M1D1M", "GATACC"))); assertTrue(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "AATACAA"))); assertTrue(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "GGTACAA"))); assertTrue(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "GATACAG"))); assertTrue(isVariantPartOfLargerMNV(98, MNV_REF_SEQUENCE, MNV, buildSamRecord(98, "7M", "GATACGA"))); }