ExtendDiploidBAF { @NotNull List<CombinedRegion> extendBAF(@NotNull final List<CombinedRegion> regions) { InferRegion inferRegion = nextRegion(false, regions); while (inferRegion.isValid()) { inferBetween(inferRegion, regions); inferRegion = nextRegion(false, regions); } inferRegion = nextRegion(true, regions); while (inferRegion.isValid()) { inferBetween(inferRegion, regions); inferRegion = nextRegion(true, regions); } return regions; } ExtendDiploidBAF(@NotNull final List<StructuralVariant> simpleVariants); @VisibleForTesting  ExtendDiploidBAF(@NotNull final Map<Long, Long> simpleDupMap);   }
@Test public void testTinyArmWithMultipleSources() { CombinedRegion cr1 = create(1, 1000, SegmentSupport.NONE, 1000, 1, 1.9); CombinedRegion cr2 = create(1001, 1030, SegmentSupport.NONE, 0, 0, 2.2); CombinedRegion cr2a = create(1001, 1031, SegmentSupport.NONE, 0, 0, 2.2); CombinedRegion cr3 = create(1031, 2000, SegmentSupport.NONE, 100, 1, 1.9); CombinedRegion cr3a = create(1032, 2000, SegmentSupport.NONE, 100, 1, 1.9); CombinedRegion cr4 = create(2001, 3000, SegmentSupport.NONE, 100, 0.666, 3); List<CombinedRegion> result = new ExtendDiploidBAF(Collections.emptyList()).extendBAF(Lists.newArrayList(cr1, cr2, cr3, cr4)); assertEquals(0, result.get(1).region().minorAlleleCopyNumber(), EPSILON); result = new ExtendDiploidBAF(Collections.emptyList()).extendBAF(Lists.newArrayList(cr1, cr2a, cr3a, cr4)); assertEquals(0.3, result.get(1).region().minorAlleleCopyNumber(), EPSILON); }
@Test public void testSmallRegionWithinLargeLOHRegion() { CombinedRegion cr1 = create(80_000_000, 100_000_000, SegmentSupport.NONE, 1000, 0.66, 3); CombinedRegion cr2 = create(100_000_001, 101_000_000, SegmentSupport.NONE, 1000, 1, 2.0); CombinedRegion cr3 = create(101_000_001, 101_001_000, SegmentSupport.NONE, 0, 0, 3.0); CombinedRegion cr4 = create(101_001_001, 104_000_000, SegmentSupport.NONE, 1000, 1, 2.0); List<CombinedRegion> result = new ExtendDiploidBAF(Collections.emptyList()).extendBAF(Lists.newArrayList(cr1, cr2, cr3, cr4)); assertEquals(0, result.get(2).region().minorAlleleCopyNumber(), EPSILON); }
@Test public void testSmallRegionWithinLargeLOHRegionAfter() { CombinedRegion cr1 = create(100_000_001, 101_000_000, SegmentSupport.NONE, 1000, 1, 2.0); CombinedRegion cr2 = create(101_000_001, 101_001_000, SegmentSupport.NONE, 0, 0, 3.0); CombinedRegion cr3 = create(101_001_001, 102_001_000, SegmentSupport.NONE, 1000, 1, 2.0); CombinedRegion cr4 = create(102_001_001, 104_000_000, SegmentSupport.NONE, 1000, 0.66, 3); List<CombinedRegion> result = new ExtendDiploidBAF(Collections.emptyList()).extendBAF(Lists.newArrayList(cr1, cr2, cr3, cr4)); assertEquals(0, result.get(1).region().minorAlleleCopyNumber(), EPSILON); }