use of org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache in project gatk-protected by broadinstitute.
the class XHMMModelUnitTest method assertTransitionProbabilities.
// CopyNumberTriStateTransitionProbabilityCache is thoroughly tested.
// Here we simply test that it is invoked properly
private void assertTransitionProbabilities(double eventStartProbability, double meanEventSize, XHMMModel model, Target fromTarget, Target toTarget) {
final CopyNumberTriStateTransitionProbabilityCache logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability);
final double distance = XHMMModel.calculateDistance(fromTarget, toTarget);
for (final CopyNumberTriState from : CopyNumberTriState.values()) {
for (final CopyNumberTriState to : CopyNumberTriState.values()) {
Assert.assertEquals(model.logTransitionProbability(from, fromTarget, to, toTarget), logTransitionProbabilityCache.logProbability((int) distance, to, from), EPSILON);
}
}
}
use of org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache in project gatk-protected by broadinstitute.
the class XHMMModelUnitTest method testLogPrior.
//the prior should be the infinite distance limit of the transition matrix
@Test(dataProvider = "testData", dependsOnMethods = "testInstantiation")
public void testLogPrior(final double eventStartProbability, final double meanEventSize, final double deletionMean, final double duplicationMean) {
final XHMMModel model = new XHMMModel(eventStartProbability, meanEventSize, deletionMean, duplicationMean);
final Target target = new Target("NAME");
final CopyNumberTriStateTransitionProbabilityCache logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability);
for (final CopyNumberTriState state : CopyNumberTriState.values()) {
Assert.assertEquals(model.logPriorProbability(state, target), logTransitionProbabilityCache.logProbability(Integer.MAX_VALUE, state, CopyNumberTriState.NEUTRAL), 1e-10);
}
}
use of org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache in project gatk by broadinstitute.
the class XHMMModelUnitTest method testLogPrior.
//the prior should be the infinite distance limit of the transition matrix
@Test(dataProvider = "testData", dependsOnMethods = "testInstantiation")
public void testLogPrior(final double eventStartProbability, final double meanEventSize, final double deletionMean, final double duplicationMean) {
final XHMMModel model = new XHMMModel(eventStartProbability, meanEventSize, deletionMean, duplicationMean);
final Target target = new Target("NAME");
final CopyNumberTriStateTransitionProbabilityCache logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability);
for (final CopyNumberTriState state : CopyNumberTriState.values()) {
Assert.assertEquals(model.logPriorProbability(state, target), logTransitionProbabilityCache.logProbability(Integer.MAX_VALUE, state, CopyNumberTriState.NEUTRAL), 1e-10);
}
}
use of org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache in project gatk by broadinstitute.
the class XHMMModelUnitTest method assertTransitionProbabilities.
// CopyNumberTriStateTransitionProbabilityCache is thoroughly tested.
// Here we simply test that it is invoked properly
private void assertTransitionProbabilities(double eventStartProbability, double meanEventSize, XHMMModel model, Target fromTarget, Target toTarget) {
final CopyNumberTriStateTransitionProbabilityCache logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability);
final double distance = XHMMModel.calculateDistance(fromTarget, toTarget);
for (final CopyNumberTriState from : CopyNumberTriState.values()) {
for (final CopyNumberTriState to : CopyNumberTriState.values()) {
Assert.assertEquals(model.logTransitionProbability(from, fromTarget, to, toTarget), logTransitionProbabilityCache.logProbability((int) distance, to, from), EPSILON);
}
}
}
Aggregations