use of org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCount in project gatk by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetTumorHetPulldown15.
@DataProvider(name = "inputGetTumorHetPulldownMin15")
public Object[][] inputGetTumorHetPulldown15() {
final Pulldown tumorHetPulldown = new Pulldown(normalHeader);
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
final IntervalList normalHetIntervals = new IntervalList(tumorHeader);
normalHetIntervals.add(new Interval("1", 14630, 14630));
normalHetIntervals.add(new Interval("2", 14689, 14689));
return new Object[][] { { normalHetIntervals, tumorHetPulldown } };
}
use of org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCount in project gatk by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetNormalHetPulldown.
@DataProvider(name = "inputGetNormalHetPulldown")
public Object[][] inputGetNormalHetPulldown() {
final Pulldown normalHetPulldown1 = new Pulldown(normalHeader);
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
//changing pValThreshold from 0.05 -> 0.95 only keeps hets close to balanced
final Pulldown normalHetPulldown2 = new Pulldown(normalHeader);
normalHetPulldown2.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
normalHetPulldown2.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
return new Object[][] { { 0.05, normalHetPulldown1 }, { 0.95, normalHetPulldown2 } };
}
use of org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCount in project gatk by broadinstitute.
the class AlleleFractionHMMUnitTest method equalMinorFractionsTest.
// if all states have the same minor fraction, then regardless of data the hidden state probabilities are
// proportional to the weights
@Test
public void equalMinorFractionsTest() {
// only the second state
final List<Double> weights = Arrays.asList(0.2, 0.3, 0.5);
final List<Double> minorAlleleFractions = Arrays.asList(0.3, 0.3, 0.3);
final double memoryLength = 1e3;
final AlleleFractionGlobalParameters params = new AlleleFractionGlobalParameters(0.1, 0.01, 0.03);
final AlleleFractionHMM model = new AlleleFractionHMM(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, params);
final Random random = new Random(13);
final int chainLength = 10000;
final List<SimpleInterval> positions = new ArrayList<>();
final List<AllelicCount> data = new ArrayList<>();
int position = 1;
for (int n = 0; n < chainLength; n++) {
position += random.nextInt((int) (2 * memoryLength));
final SimpleInterval interval = new SimpleInterval("chr1", position, position);
positions.add(interval);
data.add(new AllelicCount(interval, random.nextInt(30) + 1, random.nextInt(30) + 1));
}
final ForwardBackwardAlgorithm.Result<AllelicCount, SimpleInterval, Integer> fbResult = ForwardBackwardAlgorithm.apply(data, positions, model);
for (int pos = 0; pos < chainLength; pos++) {
for (int state = 0; state < weights.size(); state++) {
Assert.assertEquals(fbResult.logProbability(pos, state), Math.log(weights.get(state)), 1e-5);
}
}
}
use of org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCount in project gatk-protected by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetNormalHetPulldown.
@DataProvider(name = "inputGetNormalHetPulldown")
public Object[][] inputGetNormalHetPulldown() {
final Pulldown normalHetPulldown1 = new Pulldown(normalHeader);
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
normalHetPulldown1.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
//changing pValThreshold from 0.05 -> 0.95 only keeps hets close to balanced
final Pulldown normalHetPulldown2 = new Pulldown(normalHeader);
normalHetPulldown2.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
normalHetPulldown2.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
return new Object[][] { { 0.05, normalHetPulldown1 }, { 0.95, normalHetPulldown2 } };
}
use of org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCount in project gatk-protected by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetTumorHetPulldown.
@DataProvider(name = "inputGetTumorHetPulldown")
public Object[][] inputGetTumorHetPulldown() {
final Pulldown tumorHetPulldown = new Pulldown(normalHeader);
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
final IntervalList normalHetIntervals = new IntervalList(tumorHeader);
normalHetIntervals.add(new Interval("1", 11522, 11522));
normalHetIntervals.add(new Interval("1", 12098, 12098));
normalHetIntervals.add(new Interval("1", 14630, 14630));
normalHetIntervals.add(new Interval("2", 14689, 14689));
normalHetIntervals.add(new Interval("2", 14982, 14982));
return new Object[][] { { normalHetIntervals, tumorHetPulldown } };
}
Aggregations