use of org.broadinstitute.hellbender.tools.pon.coverage.pca.RamPCACoveragePoN in project gatk by broadinstitute.
the class CreatePanelOfNormalsIntegrationTest method assertRamPoNDuplicate.
/**
* Assert that we can create a valid ram pon duplicate.
*
* @param pon never {@code null}
*/
private void assertRamPoNDuplicate(final PCACoveragePoN pon) {
final PCACoveragePoN ramPoN = new RamPCACoveragePoN(pon);
PoNTestUtils.assertEqualsMatrix(pon.getLogNormalizedCounts(), ramPoN.getLogNormalizedCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getLogNormalizedPInverseCounts(), ramPoN.getLogNormalizedPInverseCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getNormalizedCounts(), ramPoN.getNormalizedCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getReducedPanelCounts(), ramPoN.getReducedPanelCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getReducedPanelPInverseCounts(), ramPoN.getReducedPanelPInverseCounts(), false);
PoNTestUtils.assertEqualsDoubleArrays(pon.getTargetFactors(), ramPoN.getTargetFactors());
final List<Target> ponPanelTargets = pon.getPanelTargets();
final List<Target> ponTargets = pon.getTargets();
final List<Target> ponRawTargets = pon.getRawTargets();
final List<Target> ramPoNPanelTargets = ramPoN.getPanelTargets();
final List<Target> ramPoNTargets = ramPoN.getTargets();
final List<Target> ramPoNRawTargets = ramPoN.getRawTargets();
Assert.assertEquals(ponPanelTargets.size(), ramPoNPanelTargets.size());
Assert.assertEquals(ponTargets.size(), ramPoNTargets.size());
// Make sure every target is the same
Assert.assertTrue(IntStream.range(0, ponRawTargets.size()).boxed().allMatch(i -> ponRawTargets.get(i).equals(ramPoNRawTargets.get(i))));
Assert.assertTrue(IntStream.range(0, ponTargets.size()).boxed().allMatch(i -> ponTargets.get(i).equals(ramPoNTargets.get(i))));
Assert.assertTrue(IntStream.range(0, ponPanelTargets.size()).boxed().allMatch(i -> ponPanelTargets.get(i).equals(ramPoNPanelTargets.get(i))));
// Make sure every sample name is the same
Assert.assertTrue(IntStream.range(0, pon.getSampleNames().size()).boxed().allMatch(i -> pon.getSampleNames().get(i).equals(ramPoN.getSampleNames().get(i))));
Assert.assertTrue(IntStream.range(0, pon.getPanelSampleNames().size()).boxed().allMatch(i -> pon.getPanelSampleNames().get(i).equals(ramPoN.getPanelSampleNames().get(i))));
// Make sure every target name is the same
Assert.assertTrue(IntStream.range(0, pon.getTargetNames().size()).boxed().allMatch(i -> pon.getTargetNames().get(i).equals(ramPoN.getTargetNames().get(i))));
Assert.assertTrue(IntStream.range(0, pon.getPanelTargetNames().size()).boxed().allMatch(i -> pon.getPanelTargetNames().get(i).equals(ramPoN.getPanelTargetNames().get(i))));
}
use of org.broadinstitute.hellbender.tools.pon.coverage.pca.RamPCACoveragePoN in project gatk-protected by broadinstitute.
the class CreatePanelOfNormalsIntegrationTest method assertRamPoNDuplicate.
/**
* Assert that we can create a valid ram pon duplicate.
*
* @param pon never {@code null}
*/
private void assertRamPoNDuplicate(final PCACoveragePoN pon) {
final PCACoveragePoN ramPoN = new RamPCACoveragePoN(pon);
PoNTestUtils.assertEqualsMatrix(pon.getLogNormalizedCounts(), ramPoN.getLogNormalizedCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getLogNormalizedPInverseCounts(), ramPoN.getLogNormalizedPInverseCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getNormalizedCounts(), ramPoN.getNormalizedCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getReducedPanelCounts(), ramPoN.getReducedPanelCounts(), false);
PoNTestUtils.assertEqualsMatrix(pon.getReducedPanelPInverseCounts(), ramPoN.getReducedPanelPInverseCounts(), false);
PoNTestUtils.assertEqualsDoubleArrays(pon.getTargetFactors(), ramPoN.getTargetFactors());
final List<Target> ponPanelTargets = pon.getPanelTargets();
final List<Target> ponTargets = pon.getTargets();
final List<Target> ponRawTargets = pon.getRawTargets();
final List<Target> ramPoNPanelTargets = ramPoN.getPanelTargets();
final List<Target> ramPoNTargets = ramPoN.getTargets();
final List<Target> ramPoNRawTargets = ramPoN.getRawTargets();
Assert.assertEquals(ponPanelTargets.size(), ramPoNPanelTargets.size());
Assert.assertEquals(ponTargets.size(), ramPoNTargets.size());
// Make sure every target is the same
Assert.assertTrue(IntStream.range(0, ponRawTargets.size()).boxed().allMatch(i -> ponRawTargets.get(i).equals(ramPoNRawTargets.get(i))));
Assert.assertTrue(IntStream.range(0, ponTargets.size()).boxed().allMatch(i -> ponTargets.get(i).equals(ramPoNTargets.get(i))));
Assert.assertTrue(IntStream.range(0, ponPanelTargets.size()).boxed().allMatch(i -> ponPanelTargets.get(i).equals(ramPoNPanelTargets.get(i))));
// Make sure every sample name is the same
Assert.assertTrue(IntStream.range(0, pon.getSampleNames().size()).boxed().allMatch(i -> pon.getSampleNames().get(i).equals(ramPoN.getSampleNames().get(i))));
Assert.assertTrue(IntStream.range(0, pon.getPanelSampleNames().size()).boxed().allMatch(i -> pon.getPanelSampleNames().get(i).equals(ramPoN.getPanelSampleNames().get(i))));
// Make sure every target name is the same
Assert.assertTrue(IntStream.range(0, pon.getTargetNames().size()).boxed().allMatch(i -> pon.getTargetNames().get(i).equals(ramPoN.getTargetNames().get(i))));
Assert.assertTrue(IntStream.range(0, pon.getPanelTargetNames().size()).boxed().allMatch(i -> pon.getPanelTargetNames().get(i).equals(ramPoN.getPanelTargetNames().get(i))));
}
Aggregations