ExtendNonDiploid extends ExtendRegion { @NotNull static List<CombinedRegion> nonDiploid(final List<CombinedRegion> regions) { return new ExtendNonDiploid().extend(regions); } private  ExtendNonDiploid(); @NotNull @Override List<CombinedRegion> extend(@NotNull final List<CombinedRegion> regions);  }
@Test public void testSingleExtendLeft() { final CombinedRegion leftMost = createNonDiploidImplied(2001, 3000, 3, 0.5, SegmentSupport.BND); final CombinedRegion middle1 = createNonDiploidImplied(3001, 4000, 4, 0.6, SegmentSupport.NONE); final CombinedRegion middle2 = createNonDiploidImplied(4001, 5000, 4, 0.6, SegmentSupport.NONE); final CombinedRegion middle3 = createNonDiploidImplied(5001, 6000, 6, 0.9, SegmentSupport.NONE); final CombinedRegion rightMost = createCombinedRegion(6001, 7000, 7,1, SegmentSupport.BND); final List<CombinedRegion> regions = Lists.newArrayList(leftMost, middle1, middle2, middle3, rightMost); final List<CombinedRegion> result = ExtendNonDiploid.nonDiploid(regions); assertEquals(2, result.size()); assertCombinedRegion(2001, 6000, 4.25, CopyNumberMethod.NON_DIPLOID, result.get(0)); assertCombinedRegion(6001, 7000, 7, CopyNumberMethod.UNKNOWN, result.get(1)); }
@Test public void testSingleExtendRight() { final CombinedRegion leftMost = createNonDiploidImplied(2001, 3000, 3, 0.5, SegmentSupport.BND); final CombinedRegion middle1 = createNonDiploidImplied(3001, 4000, 4, 0.6, SegmentSupport.NONE); final CombinedRegion middle2 = createNonDiploidImplied(4001, 5000, 4, 0.6, SegmentSupport.NONE); final CombinedRegion middle3 = createNonDiploidImplied(5001, 6000, 6, 0.9, SegmentSupport.NONE); final CombinedRegion rightMost = createCombinedRegion(6001, 7000, 7, 1, SegmentSupport.BND); final List<CombinedRegion> regions = Lists.newArrayList(leftMost, middle1, middle2, middle3, rightMost); final List<CombinedRegion> result = ExtendNonDiploid.nonDiploid(regions); assertEquals(2, result.size()); assertCombinedRegion(2001, 6000, 4.25, CopyNumberMethod.NON_DIPLOID, result.get(0)); assertCombinedRegion(6001, 7000, 7, CopyNumberMethod.UNKNOWN, result.get(1)); }
@Test public void testTwoSVsExtendBetween() { final CombinedRegion leftMost = createNonDiploidImplied(2001, 3000, 3, 0.5, SegmentSupport.BND); final CombinedRegion middle1 = createNonDiploidImplied(3001, 4000, 4, 0.6, SegmentSupport.NONE); final CombinedRegion middle2 = createNonDiploidImplied(4001, 5000, 5, 0.6, SegmentSupport.NONE); final CombinedRegion middle3 = createCombinedRegion(5001, 6000, 6, 0.9, SegmentSupport.NONE); final CombinedRegion rightMost = createCombinedRegion(6001, 7000, 7, 1, SegmentSupport.BND); final List<CombinedRegion> regions = Lists.newArrayList(leftMost, middle1, middle2, middle3, rightMost); final List<CombinedRegion> result = ExtendNonDiploid.nonDiploid(regions); assertEquals(2, result.size()); assertCombinedRegion(2001, 6000, 4, CopyNumberMethod.NON_DIPLOID, result.get(0)); }