ExtendNonDiploid extends ExtendRegion { static boolean isEligible(@NotNull final FittedRegion region, @Nullable final FittedRegion neighbour) { return Doubles.greaterThan(region.observedTumorRatio(), region.observedNormalRatio()) && !region.status() .equals(GermlineStatus.DIPLOID) && !region.status().equals(GermlineStatus.NOISE) && region.depthWindowCount() > 0 && !isBoundByCentromere(region, neighbour) && isBoundBySV(region, neighbour); } private  ExtendNonDiploid(); @NotNull @Override List<CombinedRegion> extend(@NotNull final List<CombinedRegion> regions);  }
@Test public void testIsEligible() { final FittedRegion eligible = createFittedRegion(GermlineStatus.HET_DELETION, SegmentSupport.BND); final FittedRegion centromere = ImmutableFittedRegion.builder().from(eligible).support(SegmentSupport.CENTROMERE).build(); assertTrue(ExtendNonDiploid.isEligible(eligible, null)); assertTrue(ExtendNonDiploid.isEligible(eligible, eligible)); assertTrue(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).status(GermlineStatus.AMPLIFICATION).build(), null)); assertTrue(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).status(GermlineStatus.HOM_DELETION).build(), null)); assertTrue(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).status(GermlineStatus.UNKNOWN).build(), null)); assertTrue(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).support(SegmentSupport.NONE).build(), eligible)); assertFalse(ExtendNonDiploid.isEligible(eligible, centromere)); assertFalse(ExtendNonDiploid.isEligible(centromere, eligible)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).status(GermlineStatus.NOISE).build(), null)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).support(SegmentSupport.NONE).build(), null)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).status(GermlineStatus.DIPLOID).build(), null)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).depthWindowCount(0).build(), null)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).observedTumorRatio(0.9).build(), null)); assertFalse(ExtendNonDiploid.isEligible(ImmutableFittedRegion.builder().from(eligible).observedNormalRatio(1.2).build(), null)); }