MicrosatelliteIndels implements Consumer<VariantContext> { private static boolean repeatContextIsRelevant(int repeatCount, int repeatSequenceLength) { final boolean longRepeatRelevant = repeatSequenceLength >= MIN_SEQUENCE_LENGTH_FOR_LONG_REPEATS && repeatSequenceLength <= MAX_SEQUENCE_LENGTH_FOR_LONG_REPEATS && repeatCount >= MIN_REPEAT_COUNT_FOR_LONG_REPEATS; final boolean shortRepeatRelevant = repeatSequenceLength == 1 && repeatCount >= MIN_REPEAT_COUNT_FOR_SHORT_REPEATS; return longRepeatRelevant | shortRepeatRelevant; }  double microsatelliteIndelsPerMb(); @Override void accept(@NotNull final VariantContext context); void accept(@NotNull final SomaticVariant variant); static final double NUMBER_OF_MB_PER_GENOME; }
@Test public void shortRepeatContextRelevanceIsDeterminedCorrectly() { assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(4, "A")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(5, "A")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(100, "A")); }
@Test public void longRepeatContextRelevanceIsDeterminedCorrectly() { assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(3, "AT")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(4, "AT")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(100, "AT")); assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(3, "ATG")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(4, "ATG")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(100, "ATG")); assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(3, "ATGA")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(4, "ATGA")); assertTrue(MicrosatelliteIndels.repeatContextIsRelevant(100, "ATGA")); assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(3, "ATGAA")); assertFalse(MicrosatelliteIndels.repeatContextIsRelevant(4, "ATGAA")); }