+ if ( cla.isOptionSet( PATH_TO_MAFFT_OPTION ) ) {
+ if ( !realign ) {
+ ForesterUtil.fatalError( PRG_NAME, "no need to indicate path to MAFFT without realigning" );
+ }
+ path_to_mafft = cla.getOptionValueAsCleanString( PATH_TO_MAFFT_OPTION );
+ }
+ if ( cla.isOptionSet( DO_NOT_NORMALIZE_FOR_EFF_LENGTH_OPTION ) ) {
+ norm = false;
+ }
+ if ( cla.isOptionSet( STEP_FOR_DIAGNOSTICS_OPTION ) ) {
+ step_for_diagnostics = cla.getOptionValueAsInt( STEP_FOR_DIAGNOSTICS_OPTION );
+ if ( ( step_for_diagnostics < 1 )
+ || ( ( step_for_diagnostics > msa.getNumberOfSequences() ) || ( ( worst_remove > 0 ) && ( step_for_diagnostics > worst_remove ) ) ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "value for diagnostic step is out of range: "
+ + step_for_diagnostics );
+ }
+ }
+ if ( cla.isOptionSet( MIN_LENGTH_OPTION ) ) {
+ min_length = cla.getOptionValueAsInt( MIN_LENGTH_OPTION );
+ if ( ( min_length < 2 ) || ( min_length > initial_msa_stats.getMax() ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "value for minimal sequence length is out of range: "
+ + min_length );
+ }
+ }
+ if ( cla.isOptionSet( GAP_RATIO_LENGTH_OPTION ) ) {
+ gap_ratio = cla.getOptionValueAsDouble( GAP_RATIO_LENGTH_OPTION );
+ if ( ( gap_ratio < 0 ) || ( gap_ratio > 1 ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "gap ratio is out of range: " + gap_ratio );
+ }
+ }
+ if ( cla.isOptionSet( REPORT_ENTROPY ) ) {
+ report_entropy = true;
+ }
+ if ( cla.isOptionSet( OUTPUT_FORMAT_PHYLIP_OPTION ) ) {
+ output_format = MSA_FORMAT.PHYLIP;
+ }
+ if ( cla.isOptionSet( OUTPUT_REMOVED_SEQS_OPTION ) ) {
+ final String s = cla.getOptionValueAsCleanString( OUTPUT_REMOVED_SEQS_OPTION );
+ removed_seqs_out_base = new File( s );
+ }
+ if ( realign ) {
+ if ( ForesterUtil.isEmpty( path_to_mafft ) ) {
+ path_to_mafft = MsaCompactor.guessPathToMafft();
+ }
+ checkPathToMafft( path_to_mafft );
+ if ( cla.isOptionSet( MAFFT_OPTIONS ) ) {
+ mafft_options = cla.getOptionValueAsCleanString( MAFFT_OPTIONS );
+ if ( ForesterUtil.isEmpty( mafft_options ) || ( mafft_options.length() < 3 ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "illegal or empty MAFFT options: " + mafft_options );
+ }
+ }
+ }
+ else if ( cla.isOptionSet( MAFFT_OPTIONS ) ) {
+ ForesterUtil.fatalError( PRG_NAME, "no need to indicate MAFFT options without realigning" );
+ }
+ if ( cla.isOptionSet( PERFORM_PHYLOGENETIC_INFERENCE ) ) {
+ perform_phylogenetic_inference = true;
+ }
+ if ( chart_only ) {
+ if ( ( out != null ) || ( removed_seqs_out_base != null ) ) {
+ ForesterUtil
+ .fatalError( PRG_NAME,
+ "chart only, no outfile(s) produced, thus no need to indicate output file(s)" );
+ }
+ if ( !realign && cla.isOptionSet( STEP_OPTION ) ) {
+ ForesterUtil.fatalError( PRG_NAME,
+ "chart only, no re-aligning, thus no need to use step for output and re-aligning; use -"
+ + STEP_FOR_DIAGNOSTICS_OPTION + " instead" );
+ }
+ }
+ if ( perform_phylogenetic_inference ) {
+ if ( step_for_diagnostics != 1 ) {
+ ForesterUtil.fatalError( PRG_NAME,
+ "step for diagnostics reports needs to be set to 1 for tree calculation" );
+ }
+ }
+ ForesterUtil.printProgramInformation( PRG_NAME,
+ PRG_DESC,
+ PRG_VERSION,
+ PRG_DATE,
+ E_MAIL,
+ WWW,
+ ForesterUtil.getForesterLibraryInformation() );
+ System.out.println( "Input MSA : " + in );
+ System.out.println( " MSA length : " + msa.getLength() );
+ System.out.println( " Number of sequences : " + msa.getNumberOfSequences() );
+ System.out.println( " Median sequence length : " + NF_1.format( initial_msa_stats.median() ) );
+ System.out.println( " Mean sequence length : "
+ + NF_1.format( initial_msa_stats.arithmeticMean() ) );
+ System.out.println( " Max sequence length : " + ( ( int ) initial_msa_stats.getMax() ) );
+ System.out.println( " Min sequence length : " + ( ( int ) initial_msa_stats.getMin() ) );
+ if ( !chart_only ) {
+ System.out.println( "Output : " + out );