From aec83b401d5192dd5c647fd5038d7965d884b8c0 Mon Sep 17 00:00:00 2001 From: hanna Date: Mon, 5 Oct 2009 19:48:57 +0000 Subject: [PATCH] SSG multithreading doesn't play well with some I/O changes made since I last svn up'd. Reverting until I can find the reason. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1766 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/SingleSampleGenotyper.java | 44 ++++++------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SingleSampleGenotyper.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SingleSampleGenotyper.java index 937d48840..dbd58589a 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SingleSampleGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SingleSampleGenotyper.java @@ -7,7 +7,6 @@ import org.broadinstitute.sting.gatk.filters.ZeroMappingQualityReadFilter; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.LocusWalker; import org.broadinstitute.sting.gatk.walkers.ReadFilters; -import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.ReadBackedPileup; import org.broadinstitute.sting.utils.cmdLine.Argument; @@ -17,7 +16,7 @@ import org.broadinstitute.sting.utils.genotype.GenotypeWriterFactory; import java.io.File; @ReadFilters(ZeroMappingQualityReadFilter.class) -public class SingleSampleGenotyper extends LocusWalker implements TreeReducible { +public class SingleSampleGenotyper extends LocusWalker { // Control output settings @Argument(fullName = "variants_out", shortName = "varout", doc = "File to which variants should be written", required = false) public File VARIANTS_FILE = null; @@ -48,16 +47,17 @@ public class SingleSampleGenotyper extends LocusWalker= LOD_THRESHOLD) { sum.nConfidentCalls++; //System.out.printf("Call %s%n", call); - genotypeWriter.addGenotypeCall(call); + sum.writer.addGenotypeCall(call); } else sum.nNonConfidentCalls++; } return sum; } - /** - * Combine adjacent call results. - * - * @param lhs first set of partial call results from genotyper; guaranteed to have come from 'earlier' in genome. - * @param rhs second set of partial call results from genotyper; guaranteed to have come from 'later' in genome. - * - * @return combined call results. - */ - public CallResult treeReduce( CallResult lhs, CallResult rhs ) { - CallResult combined = new CallResult(); - combined.nCalledBases = lhs.nCalledBases + rhs.nCalledBases; - combined.nConfidentCalls = lhs.nConfidentCalls + rhs.nConfidentCalls; - combined.nNonConfidentCalls = lhs.nNonConfidentCalls + rhs.nNonConfidentCalls; - return combined; - } - /** Close the variant file. */ public void onTraversalDone(CallResult sum) { - // If the VARIANTS_FILE is null, the GATK is managing the output stream. Close the file. - if ( VARIANTS_FILE == null ) - genotypeWriter.close(); + sum.writer.close(); } }