A better understanding of what's going on means no need for clearing the cache

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1755 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-10-02 18:07:46 +00:00
parent e885cc4b21
commit 53a4bd7f51
4 changed files with 5 additions and 10 deletions

View File

@ -240,8 +240,6 @@ public class EmpiricalSubstitutionGenotypeLikelihoods extends GenotypeLikelihood
return EMPIRICAL_CACHE[a][i][j][k][x];
}
protected void clearCache() { EMPIRICAL_CACHE = new GenotypeLikelihoods[EmpiricalSubstitutionGenotypeLikelihoods.SequencerPlatform.values().length][BaseUtils.BASES.length][QualityUtils.MAX_QUAL_SCORE][MAX_PLOIDY][2]; }
// -----------------------------------------------------------------------------------------------------------------

View File

@ -188,11 +188,14 @@ public abstract class GenotypeLikelihoods implements Cloneable {
}
/**
* Sets the priors and clears the likelihoods cache.
* Sets the priors
*/
public void setPriors(DiploidGenotypePriors priors) {
this.priors = priors;
clearCache();
for ( DiploidGenotype g : DiploidGenotype.values() ) {
int i = g.ordinal();
posteriors[i] = priors.getPriors()[i] + likelihoods[i];
}
}
/**
@ -347,10 +350,6 @@ public abstract class GenotypeLikelihoods implements Cloneable {
*/
protected abstract GenotypeLikelihoods getSetCache( char observedBase, byte qualityScore, int ploidy,
SAMRecord read, int offset, GenotypeLikelihoods val );
/**
* Method for clearing the cache (in case we change the priors)
*/
protected abstract void clearCache();
protected GenotypeLikelihoods simpleGetSetCache( GenotypeLikelihoods[][][][] cache,
char observedBase, byte qualityScore, int ploidy,

View File

@ -47,5 +47,4 @@ public class OneStateErrorGenotypeLikelihoods extends GenotypeLikelihoods {
SAMRecord read, int offset, GenotypeLikelihoods val ) {
return simpleGetSetCache(ONE_STATE_CACHE, observedBase, qualityScore, ploidy, read, offset, val);
}
protected void clearCache() { ONE_STATE_CACHE = new GenotypeLikelihoods[BaseUtils.BASES.length][QualityUtils.MAX_QUAL_SCORE][MAX_PLOIDY][2]; }
}

View File

@ -40,5 +40,4 @@ public class ThreeStateErrorGenotypeLikelihoods extends GenotypeLikelihoods {
SAMRecord read, int offset, GenotypeLikelihoods val ) {
return simpleGetSetCache(THREE_STATE_CACHE, observedBase, qualityScore, ploidy, read, offset, val);
}
protected void clearCache() { THREE_STATE_CACHE = new GenotypeLikelihoods[BaseUtils.BASES.length][QualityUtils.MAX_QUAL_SCORE][MAX_PLOIDY][2]; }
}