+ }
+ if ( ForesterUtil.isEmpty( outgroup ) && ( rerooting == REROOTING.OUTGROUP ) ) {
+ ForesterUtil.fatalError( "selected re-rooting by outgroup, but outgroup not set" );
+ }
+ if ( !ForesterUtil.isEmpty( outgroup ) && ( rerooting != REROOTING.OUTGROUP ) ) {
+ ForesterUtil.fatalError( "outgroup set, but selected re-rooting by other approach" );
+ }
+ int gt_first = RIO.DEFAULT_RANGE;
+ int gt_last = RIO.DEFAULT_RANGE;
+ if ( cla.isOptionSet( GT_FIRST ) ) {
+ if ( sdir ) {
+ ForesterUtil.fatalError( "no gene tree range option for SDIR algorithm" );
+ }
+ if ( !cla.isOptionHasAValue( GT_FIRST ) ) {
+ ForesterUtil.fatalError( "no value for -" + GT_FIRST );
+ }
+ try {
+ gt_first = cla.getOptionValueAsInt( GT_FIRST );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( "could not parse integer for -" + GT_FIRST + " option" );
+ }
+ if ( gt_first < 0 ) {
+ ForesterUtil.fatalError( "attempt to set index of first tree to analyze to: " + gt_first );
+ }
+ }
+ if ( cla.isOptionSet( GT_LAST ) ) {
+ if ( sdir ) {
+ ForesterUtil.fatalError( "no gene tree range option for SDIR algorithm" );
+ }
+ if ( !cla.isOptionHasAValue( GT_LAST ) ) {
+ ForesterUtil.fatalError( "no value for -" + GT_LAST );
+ }
+ try {
+ gt_last = cla.getOptionValueAsInt( GT_LAST );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( "could not parse integer for -" + GT_LAST + " option" );
+ }
+ if ( gt_last < 0 ) {
+ ForesterUtil.fatalError( "attempt to set index of last tree to analyze to: " + gt_last );
+ }
+ }
+ if ( ( ( gt_last != RIO.DEFAULT_RANGE ) && ( gt_first != RIO.DEFAULT_RANGE ) ) && ( ( gt_last < gt_first ) ) ) {
+ ForesterUtil.fatalError( "attempt to set range (0-based) of gene to analyze to: from " + gt_first + " to "
+ + gt_last );
+ }
+ double ortholog_group_cutoff = ORTHOLOG_GROUPS_CUTOFF_DEFAULT;
+ if ( cla.isOptionSet( ORTHOLOG_GROUPS_CUTOFF_OPTION ) ) {
+ if ( sdir ) {
+ ForesterUtil.fatalError( "ortholog groups cutoff for SDIR algorithm" );
+ }
+ if ( !cla.isOptionHasAValue( ORTHOLOG_GROUPS_CUTOFF_OPTION ) ) {
+ ForesterUtil.fatalError( "no value for -" + ORTHOLOG_GROUPS_CUTOFF_OPTION );
+ }
+ try {
+ ortholog_group_cutoff = cla.getOptionValueAsDouble( ORTHOLOG_GROUPS_CUTOFF_OPTION );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( "could not parse double for -" + ORTHOLOG_GROUPS_CUTOFF_OPTION + " option" );
+ }
+ if ( ortholog_group_cutoff < 0 ) {
+ ForesterUtil.fatalError( "attempt to set ortholog groups cutoff to: " + ortholog_group_cutoff );
+ }
+ if ( ortholog_group_cutoff > 1 ) {
+ ForesterUtil.fatalError( "attempt to set ortholog groups cutoff to: " + ortholog_group_cutoff );
+ }
+ }
+ if ( !use_dir ) {
+ ForesterUtil.fatalErrorIfFileNotReadable( gene_trees_file );
+ }
+ final String gene_trees_suffix;
+ if ( cla.isOptionSet( GENE_TREES_SUFFIX_OPTION ) ) {
+ if ( !use_dir ) {
+ ForesterUtil.fatalError( "no gene tree suffix option when operating on indivual gene trees" );
+ }
+ if ( !cla.isOptionHasAValue( GENE_TREES_SUFFIX_OPTION ) ) {
+ ForesterUtil.fatalError( "no value for -" + GENE_TREES_SUFFIX_OPTION );
+ }
+ gene_trees_suffix = cla.getOptionValueAsCleanString( GENE_TREES_SUFFIX_OPTION );