public static String APP_VERSION = "debug";
public static String APP_BUILT_DATE = "unknown";
public static void main(String[] args) throws Exception {
Logger logger = new Logger();
NgsSmartTool tool = null;
loadAppPropertiesFile();
loadAppSettings();
if(args.length == 0 || args[0].equals("--home")){
launchGUI(args);
} else {
String toolName = args[0];
// TODO: use factories map to create tools
if(toolName.equalsIgnoreCase(Constants.TOOL_NAME_BAMQC)){
tool = new BamQcTool();
}
if(toolName.equalsIgnoreCase(Constants.TOOL_NAME_RNASEQ_QC)){
tool = new RnaSeqQcTool();
}
if(toolName.equalsIgnoreCase(Constants.TOOL_NAME_COUNTS_QC)){
tool = new CountsQcTool();
}
if (toolName.equals(Constants.TOOL_NAME_COMPUTE_COUNTS)) {
tool = new ComputeCountsTool();
}
if (toolName.equals(Constants.TOOL_NAME_CLUSTERING)) {
tool = new EpiTool();
}
if (toolName.equals(Constants.TOOL_NAME_GC_CONTENT)) {
tool = new GCContentTool();
}
if (toolName.equals(Constants.TOOL_NAME_INDEL_COUNT)) {
tool = new IndelCountTool();
}
if (toolName.equals(Constants.TOOL_NAME_MULTISAMPLE_BAM_QC)) {
tool = new MultisampleBamQcTool();
}
if (toolName.equalsIgnoreCase("run-tests")) {
System.out.println("Supposed to run tests... Needs testing");
//runTests();
} else if(toolName.equalsIgnoreCase("-h") || toolName.equalsIgnoreCase("-help")
|| toolName.equalsIgnoreCase("--h") || toolName.equalsIgnoreCase("--help")){
logger.println("");
logger.println(getHelp());
} else {
logger.println("");
logger.println("Selected tool: " + toolName);
if(tool==null){
logger.println("No proper tool name is provided.\n");
logger.println(getHelp());
} else {
try {
tool.run(args);
} catch(ParseException pe){
logger.println("");
logger.println("ERROR: " + pe.getMessage());
logger.println("");
tool.printHelp();
} catch(Exception e){
e.printStackTrace();
}
}