Remove ExactPairHMM and OriginalPairHMM, everyone just uses Log10PairHMM with appropriate arguments

This commit is contained in:
Mark DePristo 2013-02-06 21:15:31 -05:00
parent 2d802e17a4
commit 09595cdeb9
6 changed files with 22 additions and 92 deletions

View File

@ -72,10 +72,10 @@ public class LikelihoodCalculationEngine {
switch (hmmType) {
case EXACT:
pairHMM = new ExactPairHMM();
pairHMM = new Log10PairHMM(true);
break;
case ORIGINAL:
pairHMM = new OriginalPairHMM();
pairHMM = new Log10PairHMM(false);
break;
case LOGLESS_CACHING:
pairHMM = new LoglessCachingPairHMM();

View File

@ -48,14 +48,12 @@ package org.broadinstitute.sting.gatk.walkers.indels;
import com.google.java.contract.Ensures;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
import org.broadinstitute.sting.utils.Haplotype;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.clipping.ReadClipper;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.pairhmm.ExactPairHMM;
//import org.broadinstitute.sting.utils.pairhmm.LoglessCachingPairHMM;
import org.broadinstitute.sting.utils.pairhmm.OriginalPairHMM;
import org.broadinstitute.sting.utils.genotyper.PerReadAlleleLikelihoodMap;
import org.broadinstitute.sting.utils.pairhmm.Log10PairHMM;
import org.broadinstitute.sting.utils.pairhmm.PairHMM;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
@ -68,6 +66,8 @@ import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
//import org.broadinstitute.sting.utils.pairhmm.LoglessCachingPairHMM;
public class PairHMMIndelErrorModel {
public static final int BASE_QUAL_THRESHOLD = 20;
@ -116,10 +116,10 @@ public class PairHMMIndelErrorModel {
switch (hmmType) {
case EXACT:
pairHMM = new ExactPairHMM();
pairHMM = new Log10PairHMM(true);
break;
case ORIGINAL:
pairHMM = new OriginalPairHMM();
pairHMM = new Log10PairHMM(false);
break;
case LOGLESS_CACHING: //TODO: still not tested so please do not use yet
//pairHMM = new LoglessCachingPairHMM(); //TODO - add it back when the figure out how to use the protected LoglessCachingPairHMM class

View File

@ -66,8 +66,8 @@ import java.util.Random;
public class PairHMMUnitTest extends BaseTest {
private final static boolean DEBUG = false;
final static boolean EXTENSIVE_TESTING = false; // TODO -- should be true
PairHMM exactHMM = new ExactPairHMM(); // the log truth implementation
PairHMM originalHMM = new OriginalPairHMM(); // the reference implementation
PairHMM exactHMM = new Log10PairHMM(true); // the log truth implementation
PairHMM originalHMM = new Log10PairHMM(false); // the reference implementation
PairHMM loglessHMM = new LoglessCachingPairHMM();
private List<PairHMM> getHMMs() {
@ -114,11 +114,11 @@ public class PairHMMUnitTest extends BaseTest {
}
public double getTolerance(final PairHMM hmm) {
if ( hmm instanceof ExactPairHMM || hmm instanceof LoglessCachingPairHMM )
if ( hmm instanceof LoglessCachingPairHMM )
return toleranceFromExact();
if ( hmm instanceof OriginalPairHMM )
return toleranceFromReference();
else
if ( hmm instanceof Log10PairHMM ) {
return ((Log10PairHMM)hmm).isDoingExactLog10Calculations() ? toleranceFromExact() : toleranceFromReference();
} else
return toleranceFromTheoretical();
}

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2012 The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.utils.pairhmm;
/**
* Just use the Log10PairHMM directly
*/
@Deprecated()
public class ExactPairHMM extends Log10PairHMM {
/**
* Create a original PairHMM class that performs the log10 HMM with exact log10 calculations
*/
public ExactPairHMM() {
super(true);
}
}

View File

@ -50,6 +50,14 @@ public class Log10PairHMM extends PairHMM {
this.doExactLog10 = doExactLog10;
}
/**
* Is this HMM using exact log10 calculations?
* @return true if exact, false if approximate
*/
public boolean isDoingExactLog10Calculations() {
return doExactLog10;
}
@Override
public void initialize( final int READ_MAX_LENGTH, final int HAPLOTYPE_MAX_LENGTH ) {
super.initialize(READ_MAX_LENGTH, HAPLOTYPE_MAX_LENGTH);

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2012 The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.utils.pairhmm;
/**
* Just use the Log10PairHMM directly
*/
@Deprecated()
public class OriginalPairHMM extends Log10PairHMM {
/**
* Create a original PairHMM class that performs the log10 HMM with approximate log10 calculations
*/
public OriginalPairHMM() {
super(false);
}
}