package org.broadinstitute.sting.gatk; import org.broadinstitute.sting.utils.GATKErrorReport; import org.broadinstitute.sting.utils.cmdLine.*; import java.io.PrintStream; import java.util.*; /** * * User: aaron * Date: May 8, 2009 * Time: 10:50:58 AM * * The Broad Institute * SOFTWARE COPYRIGHT NOTICE AGREEMENT * This software and its documentation are copyright 2009 by the * Broad Institute/Massachusetts Institute of Technology. All rights are reserved. * * This software is supplied without any warranty or guaranteed support whatsoever. Neither * the Broad Institute nor MIT can be responsible for its use, misuse, or functionality. * */ /** * @author aaron * @version 1.0 * @date May 8, 2009 *
* Class CommandLineGATK * * We run command line GATK programs using this class. It gets the command line args, parses them, and hands the * gatk all the parsed out information. Pretty much anything dealing with the underlying system should go here, * the gatk engine should deal with any data related information. */ public class CommandLineGATK extends CommandLineExecutable { @Argument(fullName = "analysis_type", shortName = "T", doc = "Type of analysis to run") private String analysisName = null; // our argument collection, the collection of command line args we accept @ArgumentCollection private GATKArgumentCollection argCollection = new GATKArgumentCollection(); /** * Get pleasing info about the GATK. * * @return A list of Strings that contain pleasant info about the GATK. */ @Override protected ApplicationDetails getApplicationDetails() { return new ApplicationDetails(createApplicationHeader(), ApplicationDetails.createDefaultRunningInstructions(getClass()), getAdditionalHelp()); } /** * generate an error log, given the stream to write to and the exception that was thrown * * @param stream the output stream * @param e the exception */ @Override public void generateErrorLog(PrintStream stream, Exception e) { GATKErrorReport report = new GATKErrorReport(e, this.argCollection); report.reportToStream(stream); } @Override protected String getAnalysisName() { return analysisName; } @Override protected GATKArgumentCollection getArgumentCollection() { return argCollection; } /** * Required main method implementation. */ public static void main(String[] argv) { try { CommandLineGATK instance = new CommandLineGATK(); start(instance, argv); System.exit(CommandLineProgram.result); // todo -- this is a painful hack } catch (Exception e) { exitSystemWithError(e); } } /** * Creates the a short blurb about the GATK, copyright info, and where to get documentation. * * @return The application header. */ public static List