permissions = sandbox
[jalview.git] / forester / java / src / org / forester / application / msa_compactor.java
index c02bc7b..e60d886 100644 (file)
@@ -46,6 +46,12 @@ import org.forester.util.CommandLineArguments;
 import org.forester.util.DescriptiveStatistics;
 import org.forester.util.ForesterUtil;
 
+
+/*
+java -cp C:\Users\czmasek\SOFTWARE_DEV\ECLIPSE\forester\java\fo
+rester.jar org.forester.application.msa_compactor Bcl-2_e1_20_mafft -t
+*/
+
 public class msa_compactor {
 
     final private static NumberFormat NF_1                                   = new DecimalFormat( "0.#" );
@@ -388,6 +394,9 @@ public class msa_compactor {
                     msa_props = mc.chart( step, realign, norm );
                 }
                 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 ) {
@@ -412,16 +421,24 @@ public class msa_compactor {
                                               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() ) );
-        System.out.println( "  Gap ratio                          : "
+        printMsaInfo( msa, initial_msa_stats );
+    }
+
+    private static void printMsaInfo( DeleteableMsa msa, final DescriptiveStatistics msa_stats ) {
+        System.out.println( "MSA length                           : " + msa.getLength() );
+        System.out.println( "Number of sequences                  : " + msa.getNumberOfSequences() );
+        System.out.println( "Median sequence length               : " + NF_1.format( msa_stats.median() ) );
+        System.out.println( "Mean sequence length                 : "
+                + NF_1.format( msa_stats.arithmeticMean() ) );
+        System.out.println( "Max sequence length                  : " + ( ( int ) msa_stats.getMax() ) );
+        System.out.println( "Min sequence length                  : " + ( ( int ) msa_stats.getMin() ) );
+        System.out.println( "Gap ratio                            : "
                 + NF_4.format( MsaMethods.calcGapRatio( msa ) ) );
-        System.out.println( "  Normalized Shannon Entropy (entn21): "
+        System.out.println( "Mean gap count per sequence          : "
+                + NF_1.format( MsaMethods.calcNumberOfGapsStats( msa ).arithmeticMean() ) );
+        System.out.println( "Normalized Shannon Entropy (entn7)   : "
+                + NF_4.format( MsaMethods.calcNormalizedShannonsEntropy( 7, msa ) ) );
+        System.out.println( "Normalized Shannon Entropy (entn21)  : "
                 + NF_4.format( MsaMethods.calcNormalizedShannonsEntropy( 21, msa ) ) );
     }