PloidyDeviation { double minorAlleleDeviation(final double purity, final double normFactor, final double ploidy) { final double deviation = alleleDeviation(purity, normFactor, ploidy) + subMinAdditionalPenalty(0, ploidy); return Math.max(deviation, minDeviation); } PloidyDeviation(final double standardDeviation, final double minStandardDeviationPerPloidyPoint,
            final double majorAlleleSubOnePenaltyMultiplier, final double majorAlleleSubOneAdditionalPenalty, final double minDeviation);   }
@Test public void testHighPurity() { final PloidyDeviation victim = new PloidyDeviation(0.03, 0, 1, 1, 0); assertEquals(0.706, victim.minorAlleleDeviation(1, 0.63, 0.1), EPSILON); assertEquals(0.964, victim.minorAlleleDeviation(1, 0.63, 0.2), EPSILON); assertEquals(0.998, victim.minorAlleleDeviation(1, 0.63, 0.3), EPSILON); assertEquals(1.000, victim.minorAlleleDeviation(1, 0.63, 0.4), EPSILON); }