diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BatchedCallsMerger.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BatchedCallsMerger.java index 6aed600b5..3adc29e5e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BatchedCallsMerger.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/BatchedCallsMerger.java @@ -104,7 +104,7 @@ public class BatchedCallsMerger extends LocusWalker imp } // update the engine - UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, writer, null, null, null); + UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, writer, null, null); UG_engine.samples = samples; // initialize the header diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java index 2ed8c1600..7a9b609fc 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java @@ -167,24 +167,6 @@ public class DiploidGenotypeCalculationModel extends JointEstimateGenotypeCalcul calls.put(sample, cg); } - // output to beagle file if requested - if ( beagleWriter != null ) { - for ( String sample : samples ) { - GenotypeLikelihoods gl = GLs.get(sample); - if ( gl == null ) { - beagleWriter.print(" 0.0 0.0 0.0"); - continue; - } - double[] likelihoods = gl.getLikelihoods(); - beagleWriter.print(' '); - beagleWriter.print(String.format("%.6f", Math.pow(10, likelihoods[refGenotype.ordinal()]))); - beagleWriter.print(' '); - beagleWriter.print(String.format("%.6f", Math.pow(10, likelihoods[hetGenotype.ordinal()]))); - beagleWriter.print(' '); - beagleWriter.print(String.format("%.6f", Math.pow(10, likelihoods[homGenotype.ordinal()]))); - } - } - return calls; } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java index 8385f5267..b10e105fa 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java @@ -31,7 +31,6 @@ public abstract class GenotypeCalculationModel implements Cloneable { protected Logger logger; protected GenotypeWriterFactory.GENOTYPE_FORMAT OUTPUT_FORMAT; protected PrintStream verboseWriter; - protected PrintStream beagleWriter; /** * Create a new GenotypeCalculationModel object @@ -47,20 +46,17 @@ public abstract class GenotypeCalculationModel implements Cloneable { * @param UAC unified arg collection * @param outputFormat output format * @param verboseWriter verbose writer - * @param beagleWriter beagle writer */ protected void initialize(Set samples, Logger logger, UnifiedArgumentCollection UAC, GenotypeWriterFactory.GENOTYPE_FORMAT outputFormat, - PrintStream verboseWriter, - PrintStream beagleWriter) { + PrintStream verboseWriter) { this.UAC = UAC.clone(); this.samples = new TreeSet(samples); OUTPUT_FORMAT = outputFormat; this.logger = logger; this.verboseWriter = verboseWriter; - this.beagleWriter = beagleWriter; } /** diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModelFactory.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModelFactory.java index 08bfab7d5..d66d45266 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModelFactory.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModelFactory.java @@ -52,7 +52,6 @@ public class GenotypeCalculationModelFactory { * @param UAC the unified argument collection * @param outputFormat the output format * @param verboseWriter verbose writer - * @param beagleWriter beagle writer * * @return model */ @@ -60,8 +59,7 @@ public class GenotypeCalculationModelFactory { Logger logger, UnifiedArgumentCollection UAC, GenotypeWriterFactory.GENOTYPE_FORMAT outputFormat, - PrintStream verboseWriter, - PrintStream beagleWriter) { + PrintStream verboseWriter) { GenotypeCalculationModel gcm; switch ( UAC.genotypeModel ) { case JOINT_ESTIMATE: @@ -78,7 +76,7 @@ public class GenotypeCalculationModelFactory { default: throw new RuntimeException("Unexpected GenotypeCalculationModel " + UAC.genotypeModel); } - gcm.initialize(samples, logger, UAC, outputFormat, verboseWriter, beagleWriter); + gcm.initialize(samples, logger, UAC, outputFormat, verboseWriter); return gcm; } } \ No newline at end of file diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java index ae00b749b..d135c55f1 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java @@ -360,22 +360,9 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc if ( !UAC.ALL_BASES_MODE && !passesEmitThreshold(phredScaledConfidence, bestAFguess) ) return new VariantCallContext(passesCallThreshold(phredScaledConfidence)); - // output to beagle file if requested - if ( beagleWriter != null ) { - beagleWriter.print(loc); - beagleWriter.print(' '); - beagleWriter.print((char)ref); - beagleWriter.print(' '); - beagleWriter.print((char)((byte)bestAlternateAllele)); - } - // populate the sample-specific data (output it to beagle also if requested) Map genotypes = makeGenotypeCalls(ref, bestAlternateAllele, bestAFguess, contexts, loc); - // close beagle record (if requested) - if ( beagleWriter != null ) - beagleWriter.println(); - // next, the variant context data (alleles, attributes, etc.) ArrayList alleles = new ArrayList(); alleles.add(Allele.create(ref, true)); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java index 4e3ce8c59..35db3ea45 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java @@ -9,8 +9,6 @@ import org.broadinstitute.sting.gatk.contexts.variantcontext.*; import java.util.*; -import net.sf.samtools.util.SequenceUtil; - public class SimpleIndelCalculationModel extends GenotypeCalculationModel { private int MIN_COVERAGE = 6; diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index d26ebd4fb..8ce3e9ab8 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -57,9 +57,6 @@ public class UnifiedGenotyper extends LocusWalker samples = new HashSet(); public UnifiedGenotyperEngine(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC) { - initialize(toolkit, UAC, null, null, null, null, null); + initialize(toolkit, UAC, null, null, null, null); } - public UnifiedGenotyperEngine(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, PrintStream beagleWriter, VariantAnnotatorEngine engine) { - initialize(toolkit, UAC, logger, genotypeWriter, verboseWriter, beagleWriter, engine); + public UnifiedGenotyperEngine(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, VariantAnnotatorEngine engine) { + initialize(toolkit, UAC, logger, genotypeWriter, verboseWriter, engine); } - private void initialize(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, PrintStream beagleWriter, VariantAnnotatorEngine engine) { + private void initialize(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, VariantAnnotatorEngine engine) { this.UAC = UAC; this.logger = logger; this.genotypeWriter = genotypeWriter; this.verboseWriter = verboseWriter; - this.beagleWriter = beagleWriter; this.annotationEngine = engine; // deal with input errors @@ -153,7 +151,7 @@ public class UnifiedGenotyperEngine { else throw new StingException("Unsupported genotype format: " + genotypeWriter.getClass().getName()); } - gcm.set(GenotypeCalculationModelFactory.makeGenotypeCalculation(samples, logger, UAC, format, verboseWriter, beagleWriter)); + gcm.set(GenotypeCalculationModelFactory.makeGenotypeCalculation(samples, logger, UAC, format, verboseWriter)); } byte ref = refContext.getBase(); @@ -212,7 +210,7 @@ public class UnifiedGenotyperEngine { if ( stratifiedContexts == null ) return null; - DiploidGenotypePriors priors = new DiploidGenotypePriors((byte)ref, UAC.heterozygosity, DiploidGenotypePriors.PROB_OF_REFERENCE_ERROR); + DiploidGenotypePriors priors = new DiploidGenotypePriors(ref, UAC.heterozygosity, DiploidGenotypePriors.PROB_OF_REFERENCE_ERROR); call = gcm.get().callLocus(tracker, ref, rawContext.getLocation(), stratifiedContexts, priors); // annotate the call, if possible