Cheap optimization: don't keep calculating the log of a constant. (How did I not catch this before?)
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4791 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
0944184832
commit
8901e63879
|
|
@ -69,6 +69,7 @@ import static java.lang.Math.pow;
|
||||||
public class DiploidSNPGenotypeLikelihoods implements Cloneable {
|
public class DiploidSNPGenotypeLikelihoods implements Cloneable {
|
||||||
protected final static int FIXED_PLOIDY = 2;
|
protected final static int FIXED_PLOIDY = 2;
|
||||||
protected final static int MAX_PLOIDY = FIXED_PLOIDY + 1;
|
protected final static int MAX_PLOIDY = FIXED_PLOIDY + 1;
|
||||||
|
protected final static double ploidyAdjustment = log10(FIXED_PLOIDY);
|
||||||
|
|
||||||
protected boolean enableCacheFlag = true;
|
protected boolean enableCacheFlag = true;
|
||||||
protected boolean VERBOSE = false;
|
protected boolean VERBOSE = false;
|
||||||
|
|
@ -407,8 +408,6 @@ public class DiploidSNPGenotypeLikelihoods implements Cloneable {
|
||||||
gl.setToZero();
|
gl.setToZero();
|
||||||
|
|
||||||
// we need to adjust for ploidy. We take the raw p(obs | chrom) / ploidy, which is -log10(ploidy) in log space
|
// we need to adjust for ploidy. We take the raw p(obs | chrom) / ploidy, which is -log10(ploidy) in log space
|
||||||
double ploidyAdjustment = log10(FIXED_PLOIDY);
|
|
||||||
|
|
||||||
for ( DiploidGenotype g : DiploidGenotype.values() ) {
|
for ( DiploidGenotype g : DiploidGenotype.values() ) {
|
||||||
|
|
||||||
// todo assumes ploidy is 2 -- should be generalized. Obviously the below code can be turned into a loop
|
// todo assumes ploidy is 2 -- should be generalized. Obviously the below code can be turned into a loop
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue