+ if ( ( out != null ) || ( removed_seqs_out_base != null ) ) {
+ System.out.print( "Output format : " );
+ if ( output_format == MSA_FORMAT.FASTA ) {
+ System.out.println( "fasta" );
+ }
+ else if ( output_format == MSA_FORMAT.PHYLIP ) {
+ System.out.println( "phylip" );
+ }
+ else if ( output_format == MSA_FORMAT.NEXUS ) {
+ System.out.println( "nexus" );
+ }
+ }
+ if ( min_length == -1 ) {
+ if ( chart_only && !realign ) {
+ System.out.println( "Step for output and re-aligning : n/a" );
+ }
+ else {
+ if ( chart_only ) {
+ System.out.println( "Step for re-aligning : " + step );
+ }
+ else {
+ System.out.println( "Step for output and re-aligning : " + step );
+ }
+ }
+ System.out.println( "Step for diagnostics reports : " + step_for_diagnostics );
+ System.out.println( "Calculate normalized Shannon Entropy : " + report_entropy );
+ if ( normalize_for_effective_seq_length ) {
+ System.out.println( "Normalize : with individual, effective sequence lenghts" );
+ }
+ else {
+ System.out.println( "Normalize : with MSA length" );
+ }
+ System.out.println( "Realign with MAFFT : " + realign );
+ if ( realign ) {
+ System.out.println( "MAFFT options : " + mafft_options );
+ }
+ System.out.println( "Simple tree (Kimura distances, NJ) : " + perform_phylogenetic_inference );
+ }
+ System.out.println();
+ final int initial_number_of_seqs = msa.getNumberOfSequences();
+ List<MsaProperties> msa_props = null;
+ final MsaCompactor mc = new MsaCompactor( msa );
+ mc.setInfileName( in.getName() );
+ if ( ( worst_remove > 0 ) || ( av_gap > 0 ) || ( length > 0 ) || ( min_length != -1 ) ) {
+ mc.setOutputFormat( output_format );
+ mc.setOutFileBase( out );
+ }
+ if ( min_length != -1 ) {
+ mc.removeSequencesByMinimalLength( min_length );
+ }
+ else {
+ mc.setPeformPhylogenticInference( perform_phylogenetic_inference );
+ if ( removed_seqs_out_base != null ) {
+ mc.setRemovedSeqsOutBase( removed_seqs_out_base );
+ }
+ mc.setNorm( normalize_for_effective_seq_length );
+ mc.setRealign( realign );
+ if ( realign ) {
+ mc.setPathToMafft( path_to_mafft );
+ mc.setMafftOptions( mafft_options );
+ }
+ mc.setStep( step );
+ mc.setStepForDiagnostics( step_for_diagnostics );
+ mc.setCalculateNormalizedShannonEntropy( report_entropy );
+ if ( worst_remove > 0 ) {
+ msa_props = mc.removeWorstOffenders( worst_remove );
+ }
+ else if ( av_gap > 0 ) {
+ msa_props = mc.removeViaGapAverage( av_gap );
+ }
+ else if ( length > 0 ) {
+ msa_props = mc.removeViaLength( length );
+ }
+ else {
+ msa_props = mc.chart( step, realign, normalize_for_effective_seq_length );
+ }
+ Chart.display( msa_props, initial_number_of_seqs, report_entropy, in.getName() );
+ System.out.println();
+ System.out.println( "Final MSA properties" );
+ printMsaInfo( msa, MsaMethods.calculateEffectiveLengthStatistics( msa ));
+ }
+ }
+ catch ( final IllegalArgumentException iae ) {
+ // iae.printStackTrace(); //TODO remove me
+ ForesterUtil.fatalError( PRG_NAME, iae.getMessage() );
+ }
+ catch ( final IOException ioe ) {
+ // ioe.printStackTrace(); //TODO remove me
+ ForesterUtil.fatalError( PRG_NAME, ioe.getMessage() );