From 87c18603984cba7cc1a83a3dcf7c712d14809ea5 Mon Sep 17 00:00:00 2001 From: ebanks Date: Tue, 24 Nov 2009 17:00:32 +0000 Subject: [PATCH] I'm not sure I believe it, but JProfiler claims that calling FourBaseProbs.isVerbose() was taking 5% of my runtime... git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2142 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/genotyper/GenotypeLikelihoods.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoods.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoods.java index 30b7b49cb..dfde2038e 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoods.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoods.java @@ -43,6 +43,7 @@ public class GenotypeLikelihoods implements Cloneable { protected final static int MAX_PLOIDY = FIXED_PLOIDY + 1; protected boolean enableCacheFlag = true; + protected boolean VERBOSE = false; // // The fundamental data arrays associated with a Genotype Likelhoods object @@ -123,11 +124,12 @@ public class GenotypeLikelihoods implements Cloneable { } public void setVerbose(boolean v) { + VERBOSE = v; fourBaseLikelihoods.setVerbose(v); } public boolean isVerbose() { - return fourBaseLikelihoods.isVerbose(); + return VERBOSE; } public int getMinQScoreToInclude() { @@ -314,7 +316,7 @@ public class GenotypeLikelihoods implements Cloneable { for ( DiploidGenotype g : DiploidGenotype.values() ) { double likelihood = likelihoods[g.ordinal()]; - if ( isVerbose() ) { + if ( VERBOSE ) { boolean fwdStrand = ! read.getReadNegativeStrandFlag(); System.out.printf(" L(%c | G=%s, Q=%d, S=%s) = %f / %f%n", observedBase, g, qualityScore, fwdStrand ? "+" : "-", pow(10,likelihood) * 100, likelihood); @@ -397,7 +399,7 @@ public class GenotypeLikelihoods implements Cloneable { gl.log10Posteriors[g.ordinal()] += likelihood; } - if ( fourBaseLikelihoods.isVerbose() ) { + if ( VERBOSE ) { for ( DiploidGenotype g : DiploidGenotype.values() ) { System.out.printf("%s\t", g); } System.out.println(); for ( DiploidGenotype g : DiploidGenotype.values() ) { System.out.printf("%.2f\t", gl.log10Likelihoods[g.ordinal()]); }