+ String outgroup = null;
+ if ( cla.isOptionSet( OUTGROUP ) ) {
+ if ( !cla.isOptionHasAValue( OUTGROUP ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "no value for -" + OUTGROUP );
+ }
+ outgroup = cla.getOptionValueAsCleanString( OUTGROUP );
+ }
+ REROOTING rerooting = REROOTING.BY_ALGORITHM;
+ if ( cla.isOptionSet( REROOTING_OPT ) ) {
+ if ( !cla.isOptionHasAValue( REROOTING_OPT ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "no value for -" + REROOTING_OPT );
+ }
+ final String rerooting_str = cla.getOptionValueAsCleanString( REROOTING_OPT ).toLowerCase();
+ if ( rerooting_str.equals( "none" ) ) {
+ rerooting = REROOTING.NONE;
+ }
+ else if ( rerooting_str.equals( "midpoint" ) ) {
+ rerooting = REROOTING.MIDPOINT;
+ }
+ else if ( rerooting_str.equals( "outgroup" ) ) {
+ rerooting = REROOTING.OUTGROUP;
+ }
+ else {
+ ForesterUtil.fatalError( PRG_NAME, "legal values for -" + REROOTING_OPT
+ + " are: none, midpoint, or outgroup (minizming duplications is default)" );
+ }
+ }
+ int gt_first = -1;
+ int gt_last = -1;
+ if ( cla.isOptionSet( GT_FIRST ) ) {
+ if ( !cla.isOptionHasAValue( GT_FIRST ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "no value for -" + GT_FIRST );
+ }
+ try {
+ gt_first = cla.getOptionValueAsInt( GT_FIRST );
+ }
+ catch ( IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, "could not parse integer for -" + GT_FIRST );
+ }
+ }
+ if ( cla.isOptionSet( GT_LAST ) ) {
+ if ( !cla.isOptionHasAValue( GT_LAST ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "no value for -" + GT_LAST );
+ }
+ try {
+ gt_last = cla.getOptionValueAsInt( GT_LAST );
+ }
+ catch ( IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, "could not parse integer for -" + GT_LAST );
+ }
+ }