Search in sources :

Example 1 with RecalibrationArgumentCollection

use of org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection in project gatk by broadinstitute.

the class ContextCovariateUnitTest method init.

@BeforeClass
public void init() {
    RAC = new RecalibrationArgumentCollection();
    covariate = new ContextCovariate(RAC);
}
Also used : RecalibrationArgumentCollection(org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with RecalibrationArgumentCollection

use of org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection in project gatk by broadinstitute.

the class ReadGroupCovariateUnitTest method testMissingPlatformUnit.

@Test
public void testMissingPlatformUnit() {
    final String expected = "MY.7";
    final ReadGroupCovariate covariate = new ReadGroupCovariate(new RecalibrationArgumentCollection(), Arrays.asList(expected));
    SAMReadGroupRecord rg = new SAMReadGroupRecord(expected);
    runTest(rg, expected, covariate);
}
Also used : RecalibrationArgumentCollection(org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) Test(org.testng.annotations.Test)

Example 3 with RecalibrationArgumentCollection

use of org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection in project gatk by broadinstitute.

the class ReadGroupCovariateUnitTest method testMissingKey.

@Test(expectedExceptions = IllegalStateException.class)
public void testMissingKey() {
    final String id = "MY.ID";
    final String expected = "SAMPLE.1";
    final ReadGroupCovariate covariate = new ReadGroupCovariate(new RecalibrationArgumentCollection(), Arrays.asList(expected));
    final String s = covariate.formatKey(1);
}
Also used : RecalibrationArgumentCollection(org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection) Test(org.testng.annotations.Test)

Example 4 with RecalibrationArgumentCollection

use of org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection in project gatk by broadinstitute.

the class ReadGroupCovariateUnitTest method testMaxValue.

@Test
public void testMaxValue() {
    final String id = "MY.ID";
    final String expected = "SAMPLE.1";
    final ReadGroupCovariate covariate = new ReadGroupCovariate(new RecalibrationArgumentCollection(), Arrays.asList(expected));
    SAMReadGroupRecord rg = new SAMReadGroupRecord(id);
    rg.setPlatformUnit(expected);
    //there's just 1 read group, so 0 is the max value
    Assert.assertEquals(covariate.maximumKeyValue(), 0);
}
Also used : RecalibrationArgumentCollection(org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) Test(org.testng.annotations.Test)

Example 5 with RecalibrationArgumentCollection

use of org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection in project gatk by broadinstitute.

the class ReadGroupCovariateUnitTest method testSingleRecord.

@Test
public void testSingleRecord() {
    final String id = "MY.ID";
    final String expected = "SAMPLE.1";
    final ReadGroupCovariate covariate = new ReadGroupCovariate(new RecalibrationArgumentCollection(), Arrays.asList(expected));
    SAMReadGroupRecord rg = new SAMReadGroupRecord(id);
    rg.setPlatformUnit(expected);
    runTest(rg, expected, covariate);
}
Also used : RecalibrationArgumentCollection(org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection) SAMReadGroupRecord(htsjdk.samtools.SAMReadGroupRecord) Test(org.testng.annotations.Test)

Aggregations

RecalibrationArgumentCollection (org.broadinstitute.hellbender.utils.recalibration.RecalibrationArgumentCollection)9 Test (org.testng.annotations.Test)7 SAMReadGroupRecord (htsjdk.samtools.SAMReadGroupRecord)5 SAMFileHeader (htsjdk.samtools.SAMFileHeader)2 BeforeClass (org.testng.annotations.BeforeClass)2 Random (java.util.Random)1 GATKRead (org.broadinstitute.hellbender.utils.read.GATKRead)1 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1