Enabled multiple argument for GATK driver; first step towards generalized -rods <name> <type> <file> argument structure
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@325 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
1ade22121b
commit
b49f713336
|
|
@ -8,6 +8,8 @@ import net.sf.samtools.SAMFileReader.ValidationStringency;
|
||||||
import net.sf.samtools.SAMSequenceRecord;
|
import net.sf.samtools.SAMSequenceRecord;
|
||||||
import net.sf.samtools.util.RuntimeIOException;
|
import net.sf.samtools.util.RuntimeIOException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import org.apache.commons.cli.OptionBuilder;
|
||||||
|
import org.apache.commons.cli.Option;
|
||||||
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
||||||
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
|
||||||
import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
||||||
|
|
@ -96,6 +98,8 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
*/
|
*/
|
||||||
private static Logger logger = Logger.getLogger(GenomeAnalysisTK.class);
|
private static Logger logger = Logger.getLogger(GenomeAnalysisTK.class);
|
||||||
|
|
||||||
|
public static ArrayList<String> ROD_BINDINGS = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setup our arguments, both required and optional
|
* setup our arguments, both required and optional
|
||||||
|
|
@ -129,6 +133,12 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
m_parser.addOptionalArg("father", "DAD", "Father's genotype (SAM pileup)", "FATHER_GENOTYPE_FILE");
|
m_parser.addOptionalArg("father", "DAD", "Father's genotype (SAM pileup)", "FATHER_GENOTYPE_FILE");
|
||||||
m_parser.addOptionalArg("daughter", "KID", "Daughter's genotype (SAM pileup)", "DAUGHTER_GENOTYPE_FILE");
|
m_parser.addOptionalArg("daughter", "KID", "Daughter's genotype (SAM pileup)", "DAUGHTER_GENOTYPE_FILE");
|
||||||
|
|
||||||
|
// --rodBind <name> <type> <file>
|
||||||
|
Option rodBinder = OptionBuilder.withArgName("rodBind")
|
||||||
|
.hasArgs()
|
||||||
|
.withDescription( "Bind rod with <name> and <type> to <file>" )
|
||||||
|
.create("B");
|
||||||
|
m_parser.addOptionalArg(rodBinder, "ROD_BINDINGS");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -172,6 +182,11 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
final boolean TEST_ROD = false;
|
final boolean TEST_ROD = false;
|
||||||
List<ReferenceOrderedData<? extends ReferenceOrderedDatum> > rods = new ArrayList<ReferenceOrderedData<? extends ReferenceOrderedDatum> >();
|
List<ReferenceOrderedData<? extends ReferenceOrderedDatum> > rods = new ArrayList<ReferenceOrderedData<? extends ReferenceOrderedDatum> >();
|
||||||
|
|
||||||
|
if ( ROD_BINDINGS != null ) {
|
||||||
|
System.out.printf("ROD BINDINGS are %s%n", Utils.join(":", ROD_BINDINGS));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( TEST_ROD ) {
|
if ( TEST_ROD ) {
|
||||||
ReferenceOrderedData<rodGFF> gff = new ReferenceOrderedData<rodGFF>("test", new File("trunk/data/gFFTest.gff"), rodGFF.class );
|
ReferenceOrderedData<rodGFF> gff = new ReferenceOrderedData<rodGFF>("test", new File("trunk/data/gFFTest.gff"), rodGFF.class );
|
||||||
gff.testMe();
|
gff.testMe();
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,11 @@ public class ArgumentParser {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addOptionalArg(Option opt, String fieldname) {
|
||||||
|
// add it to the option
|
||||||
|
AddToOptionStorage(opt, fieldname);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used locally to add to the options storage we have, for latter processing
|
* Used locally to add to the options storage we have, for latter processing
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue