StructuralVariantImplied { private void inferCopyNumberFromStructuralVariants(@NotNull final CombinedRegion region, @NotNull final Optional<StructuralVariantLegPloidy> start, @NotNull final Optional<StructuralVariantLegPloidy> end) { region.setTumorCopyNumber(CopyNumberMethod.STRUCTURAL_VARIANT, inferCopyNumberFromStructuralVariants(start, end)); } StructuralVariantImplied(int averageReadDepth, double averageCopyNumber, @NotNull final PurityAdjuster purityAdjuster);   }
@Test public void testImpliedCopyNumber() { final StructuralVariantLegPloidy left = create(1, Optional.of(4d), Optional.empty()); final StructuralVariantLegPloidy right = create(-1, Optional.empty(), Optional.of(5d)); final double bothKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.of(left), Optional.of(right)); assertEquals(3.5, bothKnown, EPSILON); final double leftKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.of(left), Optional.empty()); assertEquals(3, leftKnown, EPSILON); final double rightKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.empty(), Optional.of(right)); assertEquals(4, rightKnown, EPSILON); }
@Test public void testImpliedCopyNumberCappedAtZero() { final StructuralVariantLegPloidy left = create(1, Optional.of(0.5d), Optional.empty()); final StructuralVariantLegPloidy right = create(-1, Optional.empty(), Optional.of(0.9d)); final double bothKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.of(left), Optional.of(right)); assertEquals(0, bothKnown, EPSILON); final double leftKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.of(left), Optional.empty()); assertEquals(0, leftKnown, EPSILON); final double rightKnown = StructuralVariantImplied.inferCopyNumberFromStructuralVariants(Optional.empty(), Optional.of(right)); assertEquals(0, rightKnown, EPSILON); }