@CLNames( names = {"-msms"}, required = true) @CLDescription( "The msms comand line for contex. Need the number of demes and sampling stratagy and -s to be correct. Of course this includes the stats collectors used. Dont forget that each indivd is 2 samples") public void msmsCmdLine(String[] msmsArgs) { msmsparser = new CommandLineMarshal(); try { CmdLineParser<CommandLineMarshal> marshel = CommandLineMarshal.getCacheParser(); // new // CmdLineParser<CommandLineMarshal>(msmsparser); marshel.processArguments(msmsArgs, msmsparser); sampleConfig = msmsparser.getSampleConfig(); collectors = msmsparser.getStatsCollectors(); if (collectors == null || collectors.size() == 0) { throw new RuntimeException("Need at least one -stat option"); } for (StatsCollector sc : collectors) { sc.init(); } } catch (Exception e) { System.err.println( "Error Parsing MSMS comand line. Note that all non msms options must come before the -msms switch."); throw new RuntimeException(e); } }
public static void main(String[] args) { MStoStats rse = new MStoStats(); CmdLineParser<MStoStats> parser = null; try { parser = new CmdLineParser<MStoStats>(MStoStats.class); } catch (Exception e1) { e1.printStackTrace(); return; } try { parser.processArguments(args, rse); if (rse.help) { System.err.println(parser.longUsage()); System.exit(0); } rse.run(); } catch (Exception e) { System.err.println(parser.longUsage()); if (!rse.help) e.printStackTrace(); } }