diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/SingleSampleGenotyper.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/SingleSampleGenotyper.java index 6ac926182..85a8cbaca 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/SingleSampleGenotyper.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/SingleSampleGenotyper.java @@ -18,6 +18,7 @@ import org.broadinstitute.sting.utils.cmdLine.Argument; import org.broadinstitute.sting.utils.genotype.GenotypeWriter; import org.broadinstitute.sting.utils.genotype.GenotypeWriterFactory; import org.broadinstitute.sting.utils.genotype.LikelihoodObject; +import org.broadinstitute.sting.utils.genotype.glf.GLFRecord; import java.io.File; import java.io.FileNotFoundException; @@ -29,10 +30,12 @@ public class SingleSampleGenotyper extends LocusWalker= LOD_THRESHOLD) { + //System.out.printf("AlleleFreqEstimate %s %f %f %f%n", alleleFreq,alleleFreq.lodVsNextBest, alleleFreq.lodVsRef, LOD_THRESHOLD ); + if (alleleFreq != null && (GENOTYPE ? alleleFreq.lodVsNextBest : alleleFreq.lodVsRef) >= LOD_THRESHOLD) { if (this.VAR_FORMAT == GenotypeWriterFactory.GENOTYPE_FORMAT.GELI) { - variantsOut.println(alleleFreq.asGeliString()); + variantsOut.println(alleleFreq.asGeliString()); } else if (this.VAR_FORMAT == GenotypeWriterFactory.GENOTYPE_FORMAT.TABULAR) { variantsOut.println(alleleFreq.asTabularString()); } else if (this.VAR_FORMAT == GenotypeWriterFactory.GENOTYPE_FORMAT.GLF) { SAMSequenceRecord rec = GenomeLocParser.getContigInfo(alleleFreq.location.getContig()); + + double[] likelihoods = new double[10]; for (int x = 0; x < alleleFreq.posteriors.length; x++) { - alleleFreq.posteriors[x] *= 10; + likelihoods[x] = GLFRecord.LIKELIHOOD_SCALE_FACTOR * alleleFreq.genotypeLikelihoods.likelihoods[x]; } - LikelihoodObject obj = new LikelihoodObject(alleleFreq.posteriors, LikelihoodObject.LIKELIHOOD_TYPE.LOG); + + LikelihoodObject obj = new LikelihoodObject(likelihoods, LikelihoodObject.LIKELIHOOD_TYPE.LOG); obj.setLikelihoodType(LikelihoodObject.LIKELIHOOD_TYPE.NEGITIVE_LOG); this.mGenotypeWriter.addGenotypeCall(rec,(int)alleleFreq.location.getStart(),0.0f,alleleFreq.ref,alleleFreq.depth,obj); @@ -339,7 +346,7 @@ public class SingleSampleGenotyper extends LocusWalker