use of org.dishevelled.commandline.argument.BooleanArgument in project ImmunogeneticDataTools by nmdp-bioinformatics.
the class AnalyzeGLStrings method main.
/**
* Main.
*
* @param args command line args
*/
public static void main(final String[] args) {
Switch about = new Switch("a", "about", "display about message");
Switch help = new Switch("h", "help", "display help message");
FileArgument inputFile = new FileArgument("i", "input-file", "input file, default stdin", false);
FileArgument outputFile = new FileArgument("o", "output-location", "specify an output file or an existing directory, default stdout", false);
StringArgument hladb = new StringArgument("v", "hladb-version", "HLA DB version (e.g. 3.19.0), default latest", false);
StringArgument freq = new StringArgument("f", "frequencies", "Frequency Set (e.g. nmdp, nmdp-2007, wiki), default nmdp-2007", false);
BooleanArgument warnings = new BooleanArgument("w", "warnings-only", "Only log warnings, default all GL String output", false);
FileSetArgument frequencyFiles = new FileSetArgument("q", "frequency-file(s)", "frequency input files (comma separated), default nmdp-2007 five locus", false);
FileArgument allelesFile = new FileArgument("l", "allele-file", "alleles known to have frequencies, default none", false);
ArgumentList arguments = new ArgumentList(about, help, inputFile, outputFile, hladb, freq, warnings, frequencyFiles, allelesFile);
CommandLine commandLine = new CommandLine(args);
AnalyzeGLStrings analyzeGLStrings = null;
try {
CommandLineParser.parse(commandLine, arguments);
if (about.wasFound()) {
About.about(System.out);
System.exit(0);
}
if (help.wasFound()) {
Usage.usage(USAGE, null, commandLine, arguments, System.out);
System.exit(0);
}
analyzeGLStrings = new AnalyzeGLStrings(inputFile.getValue(), outputFile.getValue(), hladb.getValue(), freq.getValue(), warnings.getValue(), frequencyFiles.getValue(), allelesFile.getValue());
} catch (CommandLineParseException | IllegalArgumentException e) {
Usage.usage(USAGE, e, commandLine, arguments, System.err);
System.exit(-1);
}
try {
System.exit(analyzeGLStrings.call());
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
Aggregations