diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalculationArguments.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalculationArguments.java deleted file mode 100755 index 7c0f92df8..000000000 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalculationArguments.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.walkers.genotyper; - -import java.util.Set; -import java.util.HashSet; - -/** - * Class for maintaining the arguments that need to be passed to UnifiedGenotyper.runGenotyper() - * (so that they only need to be computed one time) - */ -public class UGCalculationArguments { - // should we annotate dbsnp? - protected boolean annotateDbsnp = false; - // should we annotate hapmap2? - protected boolean annotateHapmap2 = false; - // should we annotate hapmap3? - protected boolean annotateHapmap3 = false; - - // the unified argument collection - protected UnifiedArgumentCollection UAC = null; - - // the model used for calculating genotypes - protected ThreadLocal gcm = new ThreadLocal(); - - // samples in input - protected Set samples = new HashSet(); -} 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 dd5bca9f5..165a89e84 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -26,19 +26,13 @@ package org.broadinstitute.sting.gatk.walkers.genotyper; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; -import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.contexts.*; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData; -import org.broadinstitute.sting.gatk.refdata.rodDbSNP; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotator; import org.broadinstitute.sting.utils.*; -import org.broadinstitute.sting.utils.pileup.*; import org.broadinstitute.sting.utils.cmdLine.*; import org.broadinstitute.sting.utils.genotype.*; -import org.broadinstitute.sting.utils.genotype.geli.GeliGenotypeWriter; -import org.broadinstitute.sting.utils.genotype.glf.GLFGenotypeWriter; import org.broadinstitute.sting.utils.genotype.vcf.*; import java.util.*; @@ -65,7 +59,7 @@ public class UnifiedGenotyper extends LocusWalker 0 && UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) { - throw new IllegalArgumentException("Attempting to use a model other than POOLED with pooled data. Please set the model to POOLED."); - } - if ( UAC.POOLSIZE < 1 && UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED ) { - throw new IllegalArgumentException("Attempting to use the POOLED model with a pool size less than 1. Please set the pool size to an appropriate value."); - } - if ( toolkit.getArguments().numberOfThreads > 1 && UAC.ASSUME_SINGLE_SAMPLE != null ) { - // the ASSUME_SINGLE_SAMPLE argument can't be handled (at least for now) while we are multi-threaded because the IO system doesn't know how to get the sample name - throw new IllegalArgumentException("For technical reasons, the ASSUME_SINGLE_SAMPLE argument cannot be used with multiple threads"); - } - - // get all of the unique sample names - unless we're in POOLED mode, in which case we ignore the sample names - if ( UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) { - // if we're supposed to assume a single sample, do so - if ( UAC.ASSUME_SINGLE_SAMPLE != null ) - UG_args.samples.add(UAC.ASSUME_SINGLE_SAMPLE); - else - UG_args.samples = SampleUtils.getSAMFileSamples(toolkit.getSAMFileHeader()); - } - - // in pooled mode we need to check that the format is acceptable - if ( UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED && writer != null ) { - // only multi-sample calls use Variations - if ( !writer.supportsMultiSample() ) - throw new IllegalArgumentException("The POOLED model is not compatible with the specified format; try using VCF instead"); - - // when using VCF with multiple threads, we need to turn down the validation stringency so that writing temporary files will work - if ( toolkit.getArguments().numberOfThreads > 1 && writer instanceof VCFGenotypeWriter ) - ((VCFGenotypeWriter)writer).setValidationStringency(VCFGenotypeWriterAdapter.VALIDATION_STRINGENCY.SILENT); - } - - // check to see whether a dbsnp rod was included - List dataSources = toolkit.getRodDataSources(); - for ( ReferenceOrderedDataSource source : dataSources ) { - ReferenceOrderedData rod = source.getReferenceOrderedData(); - if ( rod.getType().equals(rodDbSNP.class) ) { - UG_args.annotateDbsnp = true; - } - if ( rod.getName().equals("hapmap2") ) { - UG_args.annotateHapmap2 = true; - } - if ( rod.getName().equals("hapmap3") ) { - UG_args.annotateHapmap3 = true; - } - } - - return UG_args; - } - - /** - * Compute at a given locus. - * - * @param tracker the meta data tracker - * @param refContext the reference base - * @param rawContext contextual information around the locus - * @param UG_args the calculation argument collection - * @return the VariantCallContext object - */ - public static VariantCallContext runGenotyper(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext, UGCalculationArguments UG_args) { - - char ref = Character.toUpperCase(refContext.getBase()); - if ( !BaseUtils.isRegularBase(ref) ) - return null; - - // don't try to call if we couldn't read in all reads at this locus (since it wasn't properly downsampled) - if ( rawContext.hasExceededMaxPileup() ) - return null; - - ReadBackedPileup rawPileup = rawContext.getBasePileup(); - - // filter the context based on min base and mapping qualities - ReadBackedPileup pileup = rawPileup.getBaseAndMappingFilteredPileup(UG_args.UAC.MIN_BASE_QUALTY_SCORE, UG_args.UAC.MIN_MAPPING_QUALTY_SCORE); - - // filter the context based on mapping quality and mismatch rate - pileup = filterPileup(pileup, refContext, UG_args.UAC); - - // don't call when there is no coverage - if ( pileup.size() == 0 ) - return null; - - // are there too many deletions in the pileup? - if ( isValidDeletionFraction(UG_args.UAC.MAX_DELETION_FRACTION) && - (double)pileup.getNumberOfDeletions() / (double)pileup.size() > UG_args.UAC.MAX_DELETION_FRACTION ) - return null; - - // stratify the AlignmentContext and cut by sample - // Note that for testing purposes, we may want to throw multi-samples at pooled mode - Map stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(pileup, UG_args.UAC.ASSUME_SINGLE_SAMPLE, (UG_args.UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED ? PooledCalculationModel.POOL_SAMPLE_NAME : null)); - if ( stratifiedContexts == null ) - return null; - - DiploidGenotypePriors priors = new DiploidGenotypePriors(ref, UG_args.UAC.heterozygosity, DiploidGenotypePriors.PROB_OF_REFERENCE_ERROR); - VariantCallContext call = UG_args.gcm.get().callLocus(tracker, ref, rawContext.getLocation(), stratifiedContexts, priors); - - // annotate the call, if possible - if ( call != null && call.variation != null && call.variation instanceof ArbitraryFieldsBacked ) { - // first off, we want to use the *unfiltered* context for the annotations - stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(rawContext.getBasePileup()); - - Map annotations; - if ( UG_args.UAC.ALL_ANNOTATIONS ) - annotations = VariantAnnotator.getAllAnnotations(tracker, refContext, stratifiedContexts, call.variation, UG_args.annotateDbsnp, UG_args.annotateHapmap2, UG_args.annotateHapmap3); - else - annotations = VariantAnnotator.getAnnotations(tracker, refContext, stratifiedContexts, call.variation, UG_args.annotateDbsnp, UG_args.annotateHapmap2, UG_args.annotateHapmap3); - ((ArbitraryFieldsBacked)call.variation).setFields(annotations); - } - - return call; - } - - // filter based on maximum mismatches and bad mates - private static ReadBackedPileup filterPileup(ReadBackedPileup pileup, ReferenceContext refContext, UnifiedArgumentCollection UAC) { - - ArrayList filteredPileup = new ArrayList(); - for ( PileupElement p : pileup ) { - if ( (UAC.USE_BADLY_MATED_READS || !p.getRead().getReadPairedFlag() || p.getRead().getMateUnmappedFlag() || p.getRead().getMateReferenceIndex() == p.getRead().getReferenceIndex()) && - AlignmentUtils.mismatchesInRefWindow(p, refContext, true) <= UAC.MAX_MISMATCHES ) - filteredPileup.add(p); - } - return new ReadBackedPileup(pileup.getLocation(), filteredPileup); - } - - private static boolean isValidDeletionFraction(double d) { - return ( d >= 0.0 && d <= 1.0 ); - } - - // ------------------------------------------------------------------------------------------------ - // - // The following methods are walker-specific; don't use them unless you are a traversal. - // If you are a walker, stick to the static methods defined above. - // - // ------------------------------------------------------------------------------------------------ - /** * Initialize the samples, output, and genotype calculation model * **/ public void initialize() { - UG_args = getUnifiedCalculationArguments(getToolkit(), UAC, writer); + UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, writer, verboseWriter, beagleWriter); // initialize the writers if ( verboseWriter != null ) { @@ -267,16 +102,16 @@ public class UnifiedGenotyper extends LocusWalker getHeaderInfo(UGCalculationArguments UG_args) { + private Set getHeaderInfo() { Set headerInfo = new HashSet(); // this is only applicable to VCF @@ -295,11 +130,11 @@ public class UnifiedGenotyper extends LocusWalker gcm = new ThreadLocal(); + + // the various loggers and writers + protected Logger logger = null; + protected GenotypeWriter genotypeWriter = null; + protected PrintStream verboseWriter = null; + protected PrintStream beagleWriter = null; + + // samples in input + protected Set samples = new HashSet(); + + + public UnifiedGenotyperEngine(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC) { + initialize(toolkit, UAC, null, null, null, null); + } + + public UnifiedGenotyperEngine(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, PrintStream beagleWriter) { + initialize(toolkit, UAC, logger, genotypeWriter, verboseWriter, beagleWriter); + + } + + private void initialize(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, GenotypeWriter genotypeWriter, PrintStream verboseWriter, PrintStream beagleWriter) { + this.UAC = UAC; + this.logger = logger; + this.genotypeWriter = genotypeWriter; + this.verboseWriter = verboseWriter; + this.beagleWriter = beagleWriter; + + // deal with input errors + if ( UAC.POOLSIZE > 0 && UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) { + throw new IllegalArgumentException("Attempting to use a model other than POOLED with pooled data. Please set the model to POOLED."); + } + if ( UAC.POOLSIZE < 1 && UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED ) { + throw new IllegalArgumentException("Attempting to use the POOLED model with a pool size less than 1. Please set the pool size to an appropriate value."); + } + if ( toolkit.getArguments().numberOfThreads > 1 && UAC.ASSUME_SINGLE_SAMPLE != null ) { + // the ASSUME_SINGLE_SAMPLE argument can't be handled (at least for now) while we are multi-threaded because the IO system doesn't know how to get the sample name + throw new IllegalArgumentException("For technical reasons, the ASSUME_SINGLE_SAMPLE argument cannot be used with multiple threads"); + } + + // get all of the unique sample names - unless we're in POOLED mode, in which case we ignore the sample names + if ( UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) { + // if we're supposed to assume a single sample, do so + if ( UAC.ASSUME_SINGLE_SAMPLE != null ) + this.samples.add(UAC.ASSUME_SINGLE_SAMPLE); + else + this.samples = SampleUtils.getSAMFileSamples(toolkit.getSAMFileHeader()); + } + + // in pooled mode we need to check that the format is acceptable + if ( UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED && genotypeWriter != null ) { + // only multi-sample calls use Variations + if ( !genotypeWriter.supportsMultiSample() ) + throw new IllegalArgumentException("The POOLED model is not compatible with the specified format; try using VCF instead"); + + // when using VCF with multiple threads, we need to turn down the validation stringency so that writing temporary files will work + if ( toolkit.getArguments().numberOfThreads > 1 && genotypeWriter instanceof VCFGenotypeWriter ) + ((VCFGenotypeWriter)genotypeWriter).setValidationStringency(VCFGenotypeWriterAdapter.VALIDATION_STRINGENCY.SILENT); + } + + // check to see whether a dbsnp rod was included + List dataSources = toolkit.getRodDataSources(); + for ( ReferenceOrderedDataSource source : dataSources ) { + ReferenceOrderedData rod = source.getReferenceOrderedData(); + if ( rod.getType().equals(rodDbSNP.class) ) { + this.annotateDbsnp = true; + } + if ( rod.getName().equals("hapmap2") ) { + this.annotateHapmap2 = true; + } + if ( rod.getName().equals("hapmap3") ) { + this.annotateHapmap3 = true; + } + } + } + + /** + * Compute at a given locus. + * + * @param tracker the meta data tracker + * @param refContext the reference base + * @param rawContext contextual information around the locus + * @return the VariantCallContext object + */ + public VariantCallContext runGenotyper(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext) { + + // initialize the GenotypeCalculationModel for this thread if that hasn't been done yet + if ( gcm.get() == null ) { + GenotypeWriterFactory.GENOTYPE_FORMAT format = GenotypeWriterFactory.GENOTYPE_FORMAT.VCF; + if ( genotypeWriter != null ) { + if ( genotypeWriter instanceof VCFGenotypeWriter ) + format = GenotypeWriterFactory.GENOTYPE_FORMAT.VCF; + else if ( genotypeWriter instanceof GLFGenotypeWriter) + format = GenotypeWriterFactory.GENOTYPE_FORMAT.GLF; + else if ( genotypeWriter instanceof GeliGenotypeWriter) + format = GenotypeWriterFactory.GENOTYPE_FORMAT.GELI; + else + throw new StingException("Unsupported genotype format: " + genotypeWriter.getClass().getName()); + } + gcm.set(GenotypeCalculationModelFactory.makeGenotypeCalculation(samples, logger, UAC, format, verboseWriter, beagleWriter)); + } + + char ref = Character.toUpperCase(refContext.getBase()); + if ( !BaseUtils.isRegularBase(ref) ) + return null; + + // don't try to call if we couldn't read in all reads at this locus (since it wasn't properly downsampled) + if ( rawContext.hasExceededMaxPileup() ) + return null; + + ReadBackedPileup rawPileup = rawContext.getBasePileup(); + + // filter the context based on min base and mapping qualities + ReadBackedPileup pileup = rawPileup.getBaseAndMappingFilteredPileup(UAC.MIN_BASE_QUALTY_SCORE, UAC.MIN_MAPPING_QUALTY_SCORE); + + // filter the context based on mapping quality and mismatch rate + pileup = filterPileup(pileup, refContext); + + // don't call when there is no coverage + if ( pileup.size() == 0 ) + return null; + + // are there too many deletions in the pileup? + if ( isValidDeletionFraction(UAC.MAX_DELETION_FRACTION) && + (double)pileup.getNumberOfDeletions() / (double)pileup.size() > UAC.MAX_DELETION_FRACTION ) + return null; + + // stratify the AlignmentContext and cut by sample + // Note that for testing purposes, we may want to throw multi-samples at pooled mode + Map stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(pileup, UAC.ASSUME_SINGLE_SAMPLE, (UAC.genotypeModel == GenotypeCalculationModel.Model.POOLED ? PooledCalculationModel.POOL_SAMPLE_NAME : null)); + if ( stratifiedContexts == null ) + return null; + + DiploidGenotypePriors priors = new DiploidGenotypePriors(ref, UAC.heterozygosity, DiploidGenotypePriors.PROB_OF_REFERENCE_ERROR); + VariantCallContext call = gcm.get().callLocus(tracker, ref, rawContext.getLocation(), stratifiedContexts, priors); + + // annotate the call, if possible + if ( call != null && call.variation != null && call.variation instanceof ArbitraryFieldsBacked ) { + // first off, we want to use the *unfiltered* context for the annotations + stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(rawContext.getBasePileup()); + + Map annotations; + if ( UAC.ALL_ANNOTATIONS ) + annotations = VariantAnnotator.getAllAnnotations(tracker, refContext, stratifiedContexts, call.variation, annotateDbsnp, annotateHapmap2, annotateHapmap3); + else + annotations = VariantAnnotator.getAnnotations(tracker, refContext, stratifiedContexts, call.variation, annotateDbsnp, annotateHapmap2, annotateHapmap3); + ((ArbitraryFieldsBacked)call.variation).setFields(annotations); + } + + return call; + } + + // filter based on maximum mismatches and bad mates + private ReadBackedPileup filterPileup(ReadBackedPileup pileup, ReferenceContext refContext) { + + ArrayList filteredPileup = new ArrayList(); + for ( PileupElement p : pileup ) { + if ( (UAC.USE_BADLY_MATED_READS || !p.getRead().getReadPairedFlag() || p.getRead().getMateUnmappedFlag() || p.getRead().getMateReferenceIndex() == p.getRead().getReferenceIndex()) && + AlignmentUtils.mismatchesInRefWindow(p, refContext, true) <= UAC.MAX_MISMATCHES ) + filteredPileup.add(p); + } + return new ReadBackedPileup(pileup.getLocation(), filteredPileup); + } + + private static boolean isValidDeletionFraction(double d) { + return ( d >= 0.0 && d <= 1.0 ); + } +} \ No newline at end of file diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BaseTransitionTableCalculatorJavaWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BaseTransitionTableCalculatorJavaWalker.java index b1e4948eb..667639465 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BaseTransitionTableCalculatorJavaWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BaseTransitionTableCalculatorJavaWalker.java @@ -49,7 +49,7 @@ public class BaseTransitionTableCalculatorJavaWalker extends LocusWalker conditionalTables; private List usePreviousBases; @@ -62,7 +62,7 @@ public class BaseTransitionTableCalculatorJavaWalker extends LocusWalker(); previousBaseLoci = new ArrayList(); @@ -359,7 +359,7 @@ public class BaseTransitionTableCalculatorJavaWalker extends LocusWalker 0 && !calls.genotypes.get(0).isVariant(ref.getBase()) && calls.genotypes.get(0).getNegLog10PError() > confidentRefThreshold ); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java index 42774079c..0b5f3c588 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java @@ -12,7 +12,6 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.genotype.*; -import java.util.*; /** * Walker to calculate the number of mismatches, their base counts, and their quality sums at confidence ref sites" @@ -39,13 +38,13 @@ public class LocusMismatchWalker extends LocusWalker implements @Argument(fullName="skip", doc = "Only display every skip eligable sites. Defaults to all sites", required = false) int skip = 1; - private UGCalculationArguments ug; + private UnifiedGenotyperEngine ug; public void initialize() { UnifiedArgumentCollection uac = new UnifiedArgumentCollection(); uac.baseModel = BaseMismatchModel.THREE_STATE; uac.ALL_BASES = true; - ug = UnifiedGenotyper.getUnifiedCalculationArguments(getToolkit(), uac); + ug = new UnifiedGenotyperEngine(getToolkit(), uac); // print the header out.printf("loc ref genotype genotypeQ depth nMM qSumMM A C G T%n"); @@ -54,7 +53,7 @@ public class LocusMismatchWalker extends LocusWalker implements public String map( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) { String result = null; - ReadBackedPileup pileup = context.getPileup(); + ReadBackedPileup pileup = context.getBasePileup(); if ( locusIsUsable(tracker, ref, pileup, context) ) { Genotype g = getGenotype(tracker, ref, context); if ( g != null && g.isPointGenotype() ) @@ -163,7 +162,7 @@ public class LocusMismatchWalker extends LocusWalker implements } private Genotype getGenotype( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) { - VariantCallContext calls = UnifiedGenotyper.runGenotyper(tracker,ref,context, ug); + VariantCallContext calls = ug.runGenotyper(tracker,ref,context); if ( calls == null || calls.variation == null || calls.genotypes == null ) return null; else { diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/contamination/FindContaminatingReadGroupsWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/contamination/FindContaminatingReadGroupsWalker.java index 838bb47cf..8b26272ae 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/contamination/FindContaminatingReadGroupsWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/contamination/FindContaminatingReadGroupsWalker.java @@ -5,10 +5,6 @@ import org.broadinstitute.sting.gatk.walkers.genotyper.*; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; -import org.broadinstitute.sting.utils.genotype.Genotype; -import org.broadinstitute.sting.utils.genotype.VariationCall; -import org.broadinstitute.sting.utils.genotype.GenotypeCall; -import org.broadinstitute.sting.utils.Pair; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.cmdLine.Argument; @@ -16,8 +12,6 @@ import org.broadinstitute.sting.playground.utils.NamedTable; import net.sf.samtools.SAMRecord; import net.sf.samtools.SAMReadGroupRecord; -import java.util.List; - import cern.jet.stat.Probability; /** @@ -34,13 +28,13 @@ public class FindContaminatingReadGroupsWalker extends LocusWalker 0.70) { - VariantCallContext ugResult = UnifiedGenotyper.runGenotyper(tracker, ref, context, ug); + VariantCallContext ugResult = ug.runGenotyper(tracker, ref, context); if (ugResult != null && ugResult.genotypes != null && ugResult.genotypes.size() > 0) { return ugResult.genotypes.get(0).isHet(); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/secondaryBases/SecondaryBaseTransitionTableWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/secondaryBases/SecondaryBaseTransitionTableWalker.java index 9bdd63b34..ab24b85cf 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/secondaryBases/SecondaryBaseTransitionTableWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/secondaryBases/SecondaryBaseTransitionTableWalker.java @@ -26,14 +26,14 @@ import java.util.HashMap; public class SecondaryBaseTransitionTableWalker extends LocusWalker { HashMap counts = new HashMap(); - private UGCalculationArguments ug; + private UnifiedGenotyperEngine ug; private NamedTable altTable; public void initialize() { UnifiedArgumentCollection uac = new UnifiedArgumentCollection(); uac.CONFIDENCE_THRESHOLD = 50; uac.ALL_BASES = true; - ug = UnifiedGenotyper.getUnifiedCalculationArguments(getToolkit(), uac); + ug = new UnifiedGenotyperEngine(getToolkit(), uac); altTable = new NamedTable(); } @@ -46,7 +46,7 @@ public class SecondaryBaseTransitionTableWalker extends LocusWalker