Package org.broadinstitute.gatk.utils

Examples of org.broadinstitute.gatk.utils.MannWhitneyU$DitheringComparator


            fillQualsFromPileup(vc.getAlleles(), vc.getStart(), pileup, indelLikelihoodMap, refQuals, altQuals );
        }
        if (refQuals.isEmpty() && altQuals.isEmpty())
            return null;

        final MannWhitneyU mannWhitneyU = new MannWhitneyU(useDithering);
        for (final Double qual : altQuals) {
            mannWhitneyU.add(qual, MannWhitneyU.USet.SET1);
        }
        for (final Double qual : refQuals) {
            mannWhitneyU.add(qual, MannWhitneyU.USet.SET2);
        }

        if (DEBUG) {
            System.out.format("%s, REF QUALS:", this.getClass().getName());
            for (final Double qual : refQuals)
                System.out.format("%4.1f ", qual);
            System.out.println();
            System.out.format("%s, ALT QUALS:", this.getClass().getName());
            for (final Double qual : altQuals)
                System.out.format("%4.1f ", qual);
            System.out.println();

        }
        // we are testing that set1 (the alt bases) have lower quality scores than set2 (the ref bases)
        final Pair<Double, Double> testResults = mannWhitneyU.runOneSidedTest(MannWhitneyU.USet.SET1);

        final Map<String, Object> map = new HashMap<String, Object>();
        if (!Double.isNaN(testResults.first))
            map.put(getKeyNames().get(0), String.format("%.3f", testResults.first));
        return map;
View Full Code Here


        }

        if ( refQuals.isEmpty() && altQuals.isEmpty() )
            return null;

        final MannWhitneyU mannWhitneyU = new MannWhitneyU(useDithering);
        for (final Double qual : altQuals) {
            mannWhitneyU.add(qual, MannWhitneyU.USet.SET1);
        }
        for (final Double qual : refQuals) {
            mannWhitneyU.add(qual, MannWhitneyU.USet.SET2);
        }

        if (DEBUG) {
            System.out.format("%s, REF QUALS:", this.getClass().getName());
            for (final Double qual : refQuals)
                System.out.format("%4.1f ", qual);
            System.out.println();
            System.out.format("%s, ALT QUALS:", this.getClass().getName());
            for (final Double qual : altQuals)
                System.out.format("%4.1f ", qual);
            System.out.println();

        }
        // we are testing that set1 (the alt bases) have lower quality scores than set2 (the ref bases)
        final Pair<Double, Double> testResults = mannWhitneyU.runOneSidedTest(MannWhitneyU.USet.SET1);

        final Map<String, Object> map = new HashMap<>();
        if (!Double.isNaN(testResults.first))
            map.put(getKeyNames().get(0), String.format("%.3f", testResults.first));
        return map;
View Full Code Here

        return tests.toArray(new Object[][]{});
    }

    @Test(enabled = true, dataProvider = "DistributionData")
    public void testDistribution(final List<Integer> distribution1, final List<Integer> distribution2, final int numToReduceIn2, final boolean distributionsShouldBeEqual, final String debugString) {
        final MannWhitneyU mannWhitneyU = new MannWhitneyU(true);

        for ( final Integer num : distribution1 )
            mannWhitneyU.add(num, MannWhitneyU.USet.SET1);

        final List<Integer> dist2 = new ArrayList<>(distribution2);
        if ( numToReduceIn2 > 0 ) {
            int counts = 0;
            int quals = 0;

            for ( int i = 0; i < numToReduceIn2; i++ ) {
                counts++;
                quals += dist2.remove(0);
            }

            final int qual = quals / counts;
            for ( int i = 0; i < numToReduceIn2; i++ )
                dist2.add(qual);
        }

        for ( final Integer num : dist2 )
            mannWhitneyU.add(num, MannWhitneyU.USet.SET2);

        final Double result = mannWhitneyU.runTwoSidedTest().second;
        Assert.assertFalse(Double.isNaN(result));

        if ( distributionsShouldBeEqual ) {
            // TODO -- THIS IS THE FAILURE POINT OF USING REDUCED READS WITH RANK SUM TESTS
            if ( numToReduceIn2 >= observations / 2 )
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.MannWhitneyU$DitheringComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.