From 0345d9f6a517e08b864dc5eda4b3e57ea2c2e75f Mon Sep 17 00:00:00 2001 From: rpoplin Date: Tue, 26 Jan 2010 14:15:09 +0000 Subject: [PATCH] Updating the recalibrator to use non-depricated getPileup() method. Adding documentation to AnalyzeAnnotations so that the walker isn't marked as unclean at compile time. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2688 348d0f76-0448-11de-a6fe-93d51630548a --- .../recalibration/CovariateCounterWalker.java | 8 ++++---- .../variantoptimizer/AnalyzeAnnotationsWalker.java | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java index cbf75a758..6530a7acb 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java @@ -47,7 +47,7 @@ import net.sf.samtools.SAMRecord; /** * This walker is designed to work as the first pass in a two-pass processing step. * It does a by-locus traversal operating only at sites that are not in dbSNP. - * We assume that all reference mismatches we see are therefore errors and indicitive of poor base quality. + * We assume that all reference mismatches we see are therefore errors and indicative of poor base quality. * This walker generates tables based on various user-specified covariates (such as read group, reported quality score, cycle, and dinucleotide) * Since there is a large amount of data one can then calculate an empirical probability of error * given the particular covariates seen at this site, where p(error) = num mismatches / num observations @@ -238,7 +238,7 @@ public class CovariateCounterWalker extends LocusWalker { } // Only use data from non-dbsnp sites - // Assume every mismatch at a non-dbsnp site is indicitive of poor quality + // Assume every mismatch at a non-dbsnp site is indicative of poor quality if( !isSNP && ( ++numUnprocessed >= PROCESS_EVERY_NTH_LOCUS ) ) { numUnprocessed = 0; // Reset the counter because we are processing this very locus @@ -248,7 +248,7 @@ public class CovariateCounterWalker extends LocusWalker { byte[] bases; // For each read at this locus - for( PileupElement p : context.getPileup() ) { + for( PileupElement p : context.getBasePileup() ) { read = p.getRead(); offset = p.getOffset(); @@ -305,7 +305,7 @@ public class CovariateCounterWalker extends LocusWalker { * @param ref The reference base */ private static void updateMismatchCounts(final Pair counts, final AlignmentContext context, final char ref) { - for( PileupElement p : context.getPileup() ) { + for( PileupElement p : context.getBasePileup() ) { final char readChar = (char)(p.getBase()); final int readCharBaseIndex = BaseUtils.simpleBaseToBaseIndex(readChar); final int refCharBaseIndex = BaseUtils.simpleBaseToBaseIndex(ref); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/variantoptimizer/AnalyzeAnnotationsWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/variantoptimizer/AnalyzeAnnotationsWalker.java index f919667a9..58bcf5d38 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/variantoptimizer/AnalyzeAnnotationsWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/variantoptimizer/AnalyzeAnnotationsWalker.java @@ -36,9 +36,11 @@ import java.io.IOException; */ /** - * Created by IntelliJ IDEA. - * User: rpoplin - * Date: Jan 15, 2010 + * Takes variant calls as .vcf files and creates plots of truth metrics as a function of the various annotations found in the INFO field. + * + * @author rpoplin + * @since Jan 15, 2010 + * @help.summary Takes variant calls as .vcf files and creates plots of truth metrics as a function of the various annotations found in the INFO field. */ public class AnalyzeAnnotationsWalker extends RodWalker { @@ -56,7 +58,7 @@ public class AnalyzeAnnotationsWalker extends RodWalker { private int MIN_VARIANTS_PER_BIN = 1000; @Argument(fullName = "max_variants_per_bin", shortName = "maxBinSize", doc = "The maximum number of variants in a bin.", required = false) private int MAX_VARIANTS_PER_BIN = 20000; - @Argument(fullName = "sampleName", shortName = "sampleName", doc = "Only process variants for this sample.", required = false) + @Argument(fullName = "sampleName", shortName = "sampleName", doc = "If supplied, only process variants found in this sample.", required = false) private String SAMPLE_NAME = null; @@ -71,6 +73,9 @@ public class AnalyzeAnnotationsWalker extends RodWalker { // //--------------------------------------------------------------------------------------------------------------- + /** + * Create the output directory and setup the path variables + */ public void initialize() { // create the output directory where all the data tables and plots will go