Search in sources :

Example 1 with AllelicCountCollection

use of org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection in project gatk by broadinstitute.

the class CollectAllelicCountsIntegrationTest method testData.

@DataProvider(name = "testData")
public Object[][] testData() throws IOException {
    //counts from IGV with minMQ = 30 and minBQ = 20
    final AllelicCountCollection normalCountsExpected = new AllelicCountCollection();
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 10736, 10736), 0, 0));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12444, 12444), 0, 18));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 13059, 13059), 0, 8));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 15204, 15204), 4, 4));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15110, 15110), 6, 0));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15629, 15629), 5, 3));
    final AllelicCountCollection tumorCountsExpected = new AllelicCountCollection();
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 10736, 10736), 0, 0));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12444, 12444), 0, 17));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 13059, 13059), 0, 8));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 15204, 15204), 4, 3));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15110, 15110), 6, 0));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15629, 15629), 5, 3));
    return new Object[][] { { NORMAL_BAM_FILE, normalCountsExpected }, { TUMOR_BAM_FILE, tumorCountsExpected } };
}
Also used : AllelicCountCollection(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) AllelicCount(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCount) DataProvider(org.testng.annotations.DataProvider)

Example 2 with AllelicCountCollection

use of org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection in project gatk by broadinstitute.

the class CollectAllelicCountsIntegrationTest method test.

@Test(dataProvider = "testData")
public void test(final File inputBAMFile, final AllelicCountCollection countsExpected) {
    final File outputFile = createTempFile("collect-allelic-counts-test-output", ".tsv");
    final String[] arguments = { "-" + StandardArgumentDefinitions.INPUT_SHORT_NAME, inputBAMFile.getAbsolutePath(), "-" + ExomeStandardArgumentDefinitions.SITES_FILE_SHORT_NAME, SITES_FILE.getAbsolutePath(), "-" + StandardArgumentDefinitions.REFERENCE_SHORT_NAME, REF_FILE.getAbsolutePath(), "-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME, outputFile.getAbsolutePath() };
    runCommandLine(arguments);
    final AllelicCountCollection countsResult = new AllelicCountCollection(outputFile);
    Assert.assertEquals(countsExpected, countsResult);
}
Also used : AllelicCountCollection(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 3 with AllelicCountCollection

use of org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection in project gatk-protected by broadinstitute.

the class CollectAllelicCounts method doWork.

@Override
protected Object doWork() {
    validateArguments();
    final File referenceFile = referenceArguments.getReferenceFile();
    final IntervalList siteIntervals = IntervalList.fromFile(inputSiteIntervalsFile);
    final AllelicCountCollector allelicCountCollector = new AllelicCountCollector(referenceFile, readValidationStringency);
    logger.info("Collecting allelic counts...");
    final AllelicCountCollection allelicCounts = allelicCountCollector.collect(inputBAMFile, siteIntervals, minimumMappingQuality, minimumBaseQuality);
    allelicCounts.write(outputAllelicCountsFile);
    logger.info("Allelic counts written to " + outputAllelicCountsFile.toString());
    return "SUCCESS";
}
Also used : AllelicCountCollector(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollector) IntervalList(htsjdk.samtools.util.IntervalList) AllelicCountCollection(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection) File(java.io.File)

Example 4 with AllelicCountCollection

use of org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection in project gatk-protected by broadinstitute.

the class CollectAllelicCountsIntegrationTest method testData.

@DataProvider(name = "testData")
public Object[][] testData() throws IOException {
    //counts from IGV with minMQ = 30 and minBQ = 20
    final AllelicCountCollection normalCountsExpected = new AllelicCountCollection();
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 10736, 10736), 0, 0));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12444, 12444), 0, 18));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 13059, 13059), 0, 8));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("1", 15204, 15204), 4, 4));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15110, 15110), 6, 0));
    normalCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15629, 15629), 5, 3));
    final AllelicCountCollection tumorCountsExpected = new AllelicCountCollection();
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 10736, 10736), 0, 0));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 12444, 12444), 0, 17));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 13059, 13059), 0, 8));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("1", 15204, 15204), 4, 3));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15110, 15110), 6, 0));
    tumorCountsExpected.add(new AllelicCount(new SimpleInterval("2", 15629, 15629), 5, 3));
    return new Object[][] { { NORMAL_BAM_FILE, normalCountsExpected }, { TUMOR_BAM_FILE, tumorCountsExpected } };
}
Also used : AllelicCountCollection(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) AllelicCount(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCount) DataProvider(org.testng.annotations.DataProvider)

Example 5 with AllelicCountCollection

use of org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection in project gatk-protected by broadinstitute.

the class CollectAllelicCountsIntegrationTest method test.

@Test(dataProvider = "testData")
public void test(final File inputBAMFile, final AllelicCountCollection countsExpected) {
    final File outputFile = createTempFile("collect-allelic-counts-test-output", ".tsv");
    final String[] arguments = { "-" + StandardArgumentDefinitions.INPUT_SHORT_NAME, inputBAMFile.getAbsolutePath(), "-" + ExomeStandardArgumentDefinitions.SITES_FILE_SHORT_NAME, SITES_FILE.getAbsolutePath(), "-" + StandardArgumentDefinitions.REFERENCE_SHORT_NAME, REF_FILE.getAbsolutePath(), "-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME, outputFile.getAbsolutePath() };
    runCommandLine(arguments);
    final AllelicCountCollection countsResult = new AllelicCountCollection(outputFile);
    Assert.assertEquals(countsExpected, countsResult);
}
Also used : AllelicCountCollection(org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Aggregations

AllelicCountCollection (org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollection)6 File (java.io.File)4 IntervalList (htsjdk.samtools.util.IntervalList)2 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)2 AllelicCount (org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCount)2 AllelicCountCollector (org.broadinstitute.hellbender.tools.copynumber.allelic.alleliccount.AllelicCountCollector)2 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)2 DataProvider (org.testng.annotations.DataProvider)2 Test (org.testng.annotations.Test)2