Switch to better mechanism for supplying a default.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@615 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-05-07 01:22:01 +00:00
parent dc944ec69b
commit 752928df94
21 changed files with 67 additions and 72 deletions

View File

@ -218,6 +218,7 @@ public class GenomeAnalysisTK extends CommandLineProgram {
Walker<?,?> my_walker = null;
try {
my_walker = walkerManager.createWalkerByName( Analysis_Name );
loadArgumentsIntoObject( my_walker );
}
catch( InstantiationException ex ) {
throw new RuntimeException( "Unable to instantiate walker.", ex );

View File

@ -15,8 +15,8 @@ import java.util.List;
* To change this template use File | Settings | File Templates.
*/
public class DepthOfCoverageWalker extends LocusWalker<Integer, Pair<Long, Long>> {
@Argument(fullName="suppressLocusPrinting",doc="Suppress printing",required=false,defaultValue="false")
public boolean suppressPrinting;
@Argument(fullName="suppressLocusPrinting",doc="Suppress printing",required=false)
public boolean suppressPrinting = false;
public Integer map(RefMetaDataTracker tracker, char ref, LocusContext context) {
if ( !suppressPrinting )

View File

@ -15,11 +15,11 @@ import org.broadinstitute.sting.utils.ReadBackedPileup;
* To change this template use File | Settings | File Templates.
*/
public class PileupWalker extends LocusWalker<Integer, Integer> implements TreeReducible<Integer> {
@Argument(fullName="verbose",doc="verbose",required=false,defaultValue="false")
public boolean VERBOSE;
@Argument(fullName="verbose",doc="verbose",required=false)
public boolean VERBOSE = false;
@Argument(fullName="extended",shortName="ext",doc="extended",required=false,defaultValue="false")
public boolean EXTENDED;
@Argument(fullName="extended",shortName="ext",doc="extended",required=false)
public boolean EXTENDED = false;
public boolean FLAG_UNCOVERED_BASES = true; // todo: how do I make this a command line argument?

View File

@ -17,8 +17,8 @@ import org.broadinstitute.sting.utils.ReadBackedPileup;
* To change this template use File | Settings | File Templates.
*/
public class ValidatingPileupWalker extends LocusWalker<Integer, ValidationStats> {
@Argument(fullName="continue_after_error",doc="Continue after an error",required=false,defaultValue="false")
public boolean CONTINUE_AFTER_AN_ERROR;
@Argument(fullName="continue_after_error",doc="Continue after an error",required=false)
public boolean CONTINUE_AFTER_AN_ERROR = false;
public Integer map(RefMetaDataTracker tracker, char ref, LocusContext context) {
Pileup pileup = new ReadBackedPileup(ref, context);

View File

@ -21,10 +21,10 @@ import java.io.DataInputStream;
public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate, String>// implements AllelicVariant
{
@Argument(doc="Number of chromosomes in data") public int N;
@Argument(required=false,doc="downsample",defaultValue="0") public int DOWNSAMPLE;
@Argument(required=false,doc="downsample") public int DOWNSAMPLE = 0;
@Argument(doc="File to output GFF formatted allele frequency calls") public String GFF_OUTPUT_FILE;
@Argument(shortName="met", doc="Turns on logging of metrics on the fly with AlleleFrequency calculation") public boolean LOG_METRICS;
@Argument(required=false, defaultValue="metrics.out", doc="Name of file where metrics will output") public String METRICS_OUTPUT_FILE;
@Argument(required=false, doc="Name of file where metrics will output") public String METRICS_OUTPUT_FILE = "metrics.out";
@Argument(required=false, doc="Ignores 4-base probabilities and only uses the quality of the best/called base") public boolean FORCE_1BASE_PROBS;
protected static Logger logger = Logger.getLogger(AlleleFrequencyWalker.class);

View File

@ -15,17 +15,17 @@ import java.io.FileNotFoundException;
@WalkerName("CountCovariates")
public class CovariateCounterWalker extends LocusWalker<Integer, Integer> {
@Argument(fullName="MAX_READ_LENGTH", shortName="mrl", doc="max read length", required=false,defaultValue="101")
public int MAX_READ_LENGTH;
@Argument(fullName="MAX_READ_LENGTH", shortName="mrl", doc="max read length", required=false)
public int MAX_READ_LENGTH = 101;
@Argument(fullName="MAX_QUAL_SCORE", shortName="mqs", doc="max quality score", required=false,defaultValue="63")
public int MAX_QUAL_SCORE;
@Argument(fullName="MAX_QUAL_SCORE", shortName="mqs", doc="max quality score", required=false)
public int MAX_QUAL_SCORE = 63;
@Argument(fullName="OUTPUT_FILEROOT", shortName="outroot", required=false, defaultValue="output", doc="Filename root for the outputted logistic regression training files")
public String OUTPUT_FILEROOT;
@Argument(fullName="OUTPUT_FILEROOT", shortName="outroot", required=false, doc="Filename root for the outputted logistic regression training files")
public String OUTPUT_FILEROOT = "output";
@Argument(fullName="CREATE_TRAINING_DATA", shortName="trainingdata", required=false, defaultValue="false", doc="Create training data files for logistic regression")
public boolean CREATE_TRAINING_DATA;
@Argument(fullName="CREATE_TRAINING_DATA", shortName="trainingdata", required=false, doc="Create training data files for logistic regression")
public boolean CREATE_TRAINING_DATA = false;
int NDINUCS = 16;
RecalData[][][] data = new RecalData[MAX_READ_LENGTH+1][MAX_QUAL_SCORE+1][NDINUCS];

View File

@ -109,14 +109,14 @@ class DuplicateComp {
* To change this template use File | Settings | File Templates.
*/
public class DuplicateQualsWalker extends DuplicateWalker<List<DuplicateComp>, QualityTracker> {
@Argument(fullName="filterUnobservedQuals", shortName="filterUnobservedQuals", required=false, defaultValue="false", doc="Show only quality bins with at least one observation in the data")
public boolean FILTER_UNOBSERVED_QUALS;
@Argument(fullName="filterUnobservedQuals", shortName="filterUnobservedQuals", required=false, doc="Show only quality bins with at least one observation in the data")
public boolean FILTER_UNOBSERVED_QUALS = false;
@Argument(fullName="maxPairwiseCompsPerDupSet", shortName="maxPairwiseCompsPerDupSet", required=false, defaultValue="100", doc="Maximumize number of pairwise comparisons to perform among duplicate read sets")
public int MAX_PAIRSIZE_COMPS_PER_DUPLICATE_SET;
@Argument(fullName="maxPairwiseCompsPerDupSet", shortName="maxPairwiseCompsPerDupSet", required=false, doc="Maximumize number of pairwise comparisons to perform among duplicate read sets")
public int MAX_PAIRSIZE_COMPS_PER_DUPLICATE_SET = 100;
@Argument(fullName="combinedQuals", shortName="combinedQuals", required=false, defaultValue="false", doc="Combine and assess pairwise base qualities")
public boolean COMBINE_QUALS;
@Argument(fullName="combinedQuals", shortName="combinedQuals", required=false, doc="Combine and assess pairwise base qualities")
public boolean COMBINE_QUALS = false;
final boolean DEBUG = false;
final private boolean ACTUALLY_DO_WORK = true;

View File

@ -21,8 +21,8 @@ import java.util.List;
import java.util.ArrayList;
public class FindNonrandomSecondBestBasePiles extends LocusWalker<Integer, Integer> {
@Argument(fullName="verbose",doc="verbose",required=false,defaultValue="false")
public boolean VERBOSE;
@Argument(fullName="verbose",doc="verbose",required=false)
public boolean VERBOSE = false;
private AlleleFrequencyWalker caller_1b;
private AlleleFrequencyWalker caller_4b;

View File

@ -12,8 +12,8 @@ import java.util.List;
import net.sf.samtools.SAMRecord;
public class HybSelPerformanceWalker extends LocusWalker<Integer, HybSelPerformanceWalker.TargetInfo> {
@Argument(fullName="min_mapq", shortName="mmq", required=false, defaultValue="1", doc="Minimum mapping quality of reads to consider") public Integer MIN_MAPQ;
@Argument(fullName="include_duplicates", shortName="idup", required=false, defaultValue="false", doc="consider duplicate reads") public Boolean INCLUDE_DUPLICATE_READS;
@Argument(fullName="min_mapq", shortName="mmq", required=false, doc="Minimum mapping quality of reads to consider") public Integer MIN_MAPQ = 1;
@Argument(fullName="include_duplicates", shortName="idup", required=false, doc="consider duplicate reads") public Boolean INCLUDE_DUPLICATE_READS = false;
public static class TargetInfo {
public int counts = 0;

View File

@ -24,11 +24,11 @@ import java.io.File;
* @author Kiran Garimella
*/
public class IOCrusherWalker extends ReadWalker<SAMRecord, ArrayList<SAMFileWriter>> {
@Argument(shortName="nWaysOut",doc="n ways out",required=false,defaultValue="1")
public int nWaysOut;
@Argument(shortName="nWaysOut",doc="n ways out",required=false)
public int nWaysOut = 1;
@Argument(shortName="readScaling",doc="read scaling",required=false,defaultValue="1")
public float readScaling;
@Argument(shortName="readScaling",doc="read scaling",required=false)
public float readScaling = 1;
@Argument(shortName="outputBase",doc="output base",required=true)
public String outputBase;

View File

@ -17,13 +17,13 @@ import edu.mit.broad.picard.reference.ReferenceSequence;
@WalkerName("InspectIndels")
public class IndelInspector extends ReadWalker<Integer, Integer> {
@Argument(fullName="IndelVerbosity", shortName="iverb", required=false, defaultValue="SILENT", doc="Verbosity level: SILENT, PILESUMMARY, ALIGNMENTS") public String VERBOSITY_LEVEL;
@Argument(fullName="IndelVerbosity", shortName="iverb", required=false, doc="Verbosity level: SILENT, PILESUMMARY, ALIGNMENTS") public String VERBOSITY_LEVEL = "SILENT";
@Argument(fullName="OutputNormal", shortName="outNorm", required=true, doc="Output file (sam or bam) for non-indel related reads and indel reads that were not improved") public String OUT1;
@Argument(fullName="OutputIndel", shortName="outIndel", required=true, doc="Output file (sam or bam) for improved (realigned) indel related reads") public String OUT2;
@Argument(fullName="ControlRun", shortName="paranoid", required=false, defaultValue="false", doc="If true, all reads that would be otherwise picked and processed by this tool will be saved, unmodified, into the OutputNormal file") public boolean CONTROL_RUN;
@Argument(fullName="ControlRun", shortName="paranoid", required=false, doc="If true, all reads that would be otherwise picked and processed by this tool will be saved, unmodified, into the OutputNormal file") public boolean CONTROL_RUN = false;
@Argument(fullName="ErrorCheckMode", shortName="error", required=false, doc="Error counting mode: MM (mismatches only (from sam tags)), MC (mismatches only doing actual mismatch count on the fly (use this if tags are incorrectly set)), ERR (errors (arachne style: mm+gap lengths)), MG (count mismatches and gaps as one error each)") public String ERR_MODE;
@Argument(fullName="MaxErrors", shortName="maxError", required=false, defaultValue="10000", doc="Maximum number of errors allowed (see ERR_MODE)") public Integer MAX_ERRS;
@Argument(fullName="MaxReadLength", shortName="maxRead", required=false, defaultValue="-1", doc="Ignore reads that are longer than the specified cutoff (not a good way to do things but might be necessary because of performance issues)") public int MAX_READ_LENGTH;
@Argument(fullName="MaxErrors", shortName="maxError", required=false, doc="Maximum number of errors allowed (see ERR_MODE)") public Integer MAX_ERRS = 10000;
@Argument(fullName="MaxReadLength", shortName="maxRead", required=false, doc="Ignore reads that are longer than the specified cutoff (not a good way to do things but might be necessary because of performance issues)") public int MAX_READ_LENGTH = -1;
private int discarded_cigar_count = 0;
private int discarded_long_read_count = 0;

View File

@ -17,10 +17,10 @@ import java.util.List;
@WalkerName("IndelIntervals")
public class IndelIntervalWalker extends ReadWalker<IndelIntervalWalker.Interval, IndelIntervalWalker.Interval> {
@Argument(fullName="maxReadLength", shortName="maxRead", doc="max read length", required=false, defaultValue="-1")
public int maxReadLength;
@Argument(fullName="minIndelsPerInterval", shortName="minIndels", doc="min indels per interval", required=false, defaultValue="1")
public int minIntervalIndelCount;
@Argument(fullName="maxReadLength", shortName="maxRead", doc="max read length", required=false)
public int maxReadLength = -1;
@Argument(fullName="minIndelsPerInterval", shortName="minIndels", doc="min indels per interval", required=false)
public int minIntervalIndelCount = 1;
public void initialize() {}

View File

@ -17,8 +17,8 @@ import java.io.File;
@WalkerName("IntervalCleaner")
public class IntervalCleanerWalker extends LocusWindowWalker<Integer, Integer> {
@Argument(fullName="maxReadLength", shortName="maxRead", doc="max read length", required=false, defaultValue="-1")
public int maxReadLength;
@Argument(fullName="maxReadLength", shortName="maxRead", doc="max read length", required=false)
public int maxReadLength = -1;
@Argument(fullName="OutputCleaned", shortName="O", required=true, doc="Output file (sam or bam) for improved (realigned) reads")
public String OUT;
public static final int MAX_QUAL = 99;

View File

@ -20,8 +20,8 @@ public class LogisticRecalibrationWalker extends ReadWalker<SAMRecord, SAMFileWr
@Argument(shortName="logisticParams", doc="logistic params file", required=true)
public String logisticParamsFile;
@Argument(shortName="outputBAM", doc="output BAM file", required=false, defaultValue="")
public String outputFile;
@Argument(shortName="outputBAM", doc="output BAM file", required=false)
public String outputFile = "";
HashMap<String, LogisticRegressor> regressors = new HashMap<String, LogisticRegressor>();
private static Logger logger = Logger.getLogger(LogisticRecalibrationWalker.class);

View File

@ -21,10 +21,10 @@ import edu.mit.broad.picard.PicardException;
public class Pilot3CoverageWalker extends LocusWalker<Integer, Integer> {
@Argument(fullName = "extended", shortName="ext", doc="extended output", required=false, defaultValue = "false")
public boolean extendedOutput;
@Argument(fullName = "extended", shortName="ext", doc="extended output", required=false)
public boolean extendedOutput = false;
@Argument(fullName="min_mapq", shortName="mmq", required=false, defaultValue="1", doc="Minimum mapping quality of reads to consider") public Integer MIN_MAPQ;
@Argument(fullName="min_mapq", shortName="mmq", required=false, doc="Minimum mapping quality of reads to consider") public Integer MIN_MAPQ = 1;
public void initialize() {

View File

@ -24,7 +24,7 @@ public class PoolCaller extends LocusWalker<AlleleFrequencyEstimate, String>
List<String> sample_names = null;
//@Argument(required=false, shortName="log_metrics", defaultValue="true") public boolean LOG_METRICS;
@Argument(required=false, shortName="fractional_counts", doc="fractional counts", defaultValue="false") public boolean FRACTIONAL_COUNTS;
@Argument(required=false, shortName="fractional_counts", doc="fractional counts") public boolean FRACTIONAL_COUNTS = false;
private Random random;

View File

@ -24,10 +24,10 @@ public class PoolCallingExperiment extends LocusWalker<AlleleFrequencyEstimate,
AlleleFrequencyWalker pooled_caller = null;
List<String> sample_names = null;
@Argument(required=false, shortName="downsample", doc="downsample", defaultValue="4") public int DOWNSAMPLE;
@Argument(required=false, shortName="downsample_noise", doc="downsample noise", defaultValue="3") public int DOWNSAMPLE_NOISE;
@Argument(required=false, shortName="log_metrics", doc="log metrics", defaultValue="true") public boolean LOG_METRICS;
@Argument(required=false, shortName="fractional_counts", doc="fractional counts", defaultValue="false") public boolean FRACTIONAL_COUNTS;
@Argument(required=false, shortName="downsample", doc="downsample") public int DOWNSAMPLE = 4;
@Argument(required=false, shortName="downsample_noise", doc="downsample noise") public int DOWNSAMPLE_NOISE = 3;
@Argument(required=false, shortName="log_metrics", doc="log metrics") public boolean LOG_METRICS = true;
@Argument(required=false, shortName="fractional_counts", doc="fractional counts") public boolean FRACTIONAL_COUNTS = false;
private Random random;

View File

@ -20,9 +20,9 @@ import java.util.Random;
* @author Kiran Garimella
*/
public class ReadErrorRateWalker extends ReadWalker<boolean[], int[]> {
@Argument(fullName="printVisualHits", shortName="v", doc="print visual hits", required=false, defaultValue="false") public boolean printVisualHits;
@Argument(fullName="useNextBestBase", shortName="nb", doc="use next best base", required=false, defaultValue="false") public boolean useNextBestBase;
@Argument(fullName="useNextRandomBase", shortName="nr", doc="use next random base", required=false, defaultValue="false") public boolean useNextRandomBase;
@Argument(fullName="printVisualHits", shortName="v", doc="print visual hits", required=false) public boolean printVisualHits = false;
@Argument(fullName="useNextBestBase", shortName="nb", doc="use next best base", required=false) public boolean useNextBestBase = false;
@Argument(fullName="useNextRandomBase", shortName="nr", doc="use next random base", required=false) public boolean useNextRandomBase = false;
/**
* Ignore reads with indels or clipping

View File

@ -19,15 +19,15 @@ import java.util.*;
// j.maguire 3-7-2009
public class SingleSampleGenotyper extends LocusWalker<AlleleFrequencyEstimate, Integer> {
@Argument(fullName="metrics", shortName="met", doc="metrics", required=false, defaultValue="/dev/null") public String metricsFileName;
@Argument(fullName="metInterval", shortName="mi", doc="metInterval", required=false, defaultValue="50000") public Integer metricsInterval;
@Argument(fullName="printMetrics", shortName="printMetrics", doc="printMetrics", required=false, defaultValue="true") public Boolean printMetrics;
@Argument(fullName="lodThreshold", shortName="lod", doc="lodThreshold", required=false, defaultValue="5.0") public Double lodThreshold;
@Argument(fullName="fourBaseMode", shortName="fb", doc="fourBaseMode", required=false, defaultValue="false") public Boolean fourBaseMode;
@Argument(fullName="retest", shortName="re", doc="retest", required=false, defaultValue="false") public Boolean retest;
@Argument(fullName="qHom", shortName="qHom", doc="qHom", required=false, defaultValue="0.04") public Double qHom;
@Argument(fullName="qHet", shortName="qHet", doc="qHet", required=false, defaultValue="0.49") public Double qHet;
@Argument(fullName="qHomNonRef", shortName="qHomNonRef", doc="qHomNonRef", required=false, defaultValue="0.97") public Double qHomNonRef;
@Argument(fullName="metrics", shortName="met", doc="metrics", required=false) public String metricsFileName = "/dev/null";
@Argument(fullName="metInterval", shortName="mi", doc="metInterval", required=false) public Integer metricsInterval = 50000;
@Argument(fullName="printMetrics", shortName="printMetrics", doc="printMetrics", required=false) public Boolean printMetrics = true;
@Argument(fullName="lodThreshold", shortName="lod", doc="lodThreshold", required=false) public Double lodThreshold = 5.0;
@Argument(fullName="fourBaseMode", shortName="fb", doc="fourBaseMode", required=false) public Boolean fourBaseMode = false;
@Argument(fullName="retest", shortName="re", doc="retest", required=false) public Boolean retest = false;
@Argument(fullName="qHom", shortName="qHom", doc="qHom", required=false) public Double qHom = 0.04;
@Argument(fullName="qHet", shortName="qHet", doc="qHet", required=false) public Double qHet = 0.49;
@Argument(fullName="qHomNonRef", shortName="qHomNonRef", doc="qHomNonRef", required=false) public Double qHomNonRef = 0.97;
public AlleleMetrics metrics;

View File

@ -27,8 +27,8 @@ public class SomaticCoverageWalker extends LocusWalker<Integer, Integer> {
@Argument(fullName = "normal_sample_name", shortName = "s2", doc="normal sample name", required = true)
public String normalSampleName;
@Argument(fullName = "extended", shortName="ext", doc="extended output", required=false, defaultValue = "false")
public boolean extendedOutput;
@Argument(fullName = "extended", shortName="ext", doc="extended output", required=false)
public boolean extendedOutput = false;
// --normal_sample_name TCGA-06-0188-10B-01W --tumor_sample_name TCGA-06-0188-01A-01W

View File

@ -59,10 +59,4 @@ public @interface Argument {
* argument should be independent.
*/
String exclusive() default "";
/**
* What is the default value for this argument type.
* @return Default value of this argument type.
*/
String defaultValue() default "";
}