Search in sources :

Example 1 with CopyNumberTriStateTransitionProbabilityCache

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);
        }
    }
}
Also used : CopyNumberTriState(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriState) CopyNumberTriStateTransitionProbabilityCache(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache)

Example 2 with CopyNumberTriStateTransitionProbabilityCache

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);
    }
}
Also used : Target(org.broadinstitute.hellbender.tools.exome.Target) CopyNumberTriState(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriState) CopyNumberTriStateTransitionProbabilityCache(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache) Test(org.testng.annotations.Test)

Example 3 with CopyNumberTriStateTransitionProbabilityCache

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);
    }
}
Also used : Target(org.broadinstitute.hellbender.tools.exome.Target) CopyNumberTriState(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriState) CopyNumberTriStateTransitionProbabilityCache(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache) Test(org.testng.annotations.Test)

Example 4 with CopyNumberTriStateTransitionProbabilityCache

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);
        }
    }
}
Also used : CopyNumberTriState(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriState) CopyNumberTriStateTransitionProbabilityCache(org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache)

Aggregations

CopyNumberTriState (org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriState)4 CopyNumberTriStateTransitionProbabilityCache (org.broadinstitute.hellbender.tools.exome.germlinehmm.CopyNumberTriStateTransitionProbabilityCache)4 Target (org.broadinstitute.hellbender.tools.exome.Target)2 Test (org.testng.annotations.Test)2