+ boolean perform_gsdir_on_best_tree;
+ final File best_trees_indir;
+ if ( cla.isOptionSet( CONSENSUS_TREES_DIR_OPTION ) ) {
+ best_trees_indir = new File( cla.getOptionValue( CONSENSUS_TREES_DIR_OPTION ) );
+ perform_gsdir_on_best_tree = true;
+ if ( !use_dir ) {
+ ForesterUtil
+ .fatalError( "no consensus (\"best\") gene tree GSDIR analysis when operating on individual gene trees" );
+ }
+ if ( !best_trees_indir.exists() ) {
+ ForesterUtil.fatalError( "consensus (\"best\") gene tree directory \"" + best_trees_indir
+ + "\" does not exist" );
+ }
+ if ( !best_trees_indir.isDirectory() ) {
+ ForesterUtil.fatalError( "consensus (\"best\") gene tree directory \"" + best_trees_indir
+ + "\" is not a directory" );
+ }
+ if ( best_trees_indir.listFiles().length < 1 ) {
+ ForesterUtil
+ .fatalError( "consensus (\"best\") gene tree directory \"" + best_trees_indir + "\" is empty" );
+ }
+ }
+ else {
+ best_trees_indir = null;
+ perform_gsdir_on_best_tree = false;
+ }
+ final String best_trees_suffix;
+ if ( cla.isOptionSet( CONSENSUS_TREES_SUFFIX_OPTION ) ) {
+ if ( !use_dir ) {
+ ForesterUtil
+ .fatalError( "no consensus (\"best\") gene tree suffix option when operating on individual gene trees" );
+ }
+ if ( !perform_gsdir_on_best_tree ) {
+ ForesterUtil.fatalError( "no consensus (\"best\") gene tree directory given" );
+ }
+ if ( !cla.isOptionHasAValue( CONSENSUS_TREES_SUFFIX_OPTION ) ) {
+ ForesterUtil.fatalError( "no value for -" + CONSENSUS_TREES_SUFFIX_OPTION );
+ }
+ best_trees_suffix = cla.getOptionValueAsCleanString( CONSENSUS_TREES_SUFFIX_OPTION );
+ }
+ else {
+ best_trees_suffix = CONSENSUS_TREE_SUFFIX_DEFAULT;
+ }