in progress
[jalview.git] / forester / java / src / org / forester / msa_compactor / MsaCompactor.java
index 687951c..b4d2fe7 100644 (file)
@@ -179,6 +179,7 @@ public class MsaCompactor {
             }
             ++i;
         }
+        
         if ( _phylogentic_inference ) {
             decorateTree( phy, msa_props, true );
             displayTree( phy );
@@ -245,14 +246,14 @@ public class MsaCompactor {
                 }
                 else {
                     n.getNodeData()
-                            .getNodeVisualData()
-                            .setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(),
-                                                                   min,
-                                                                   max,
-                                                                   mean,
-                                                                   min_color,
-                                                                   max_color,
-                                                                   mean_color ) );
+                    .getNodeVisualData()
+                    .setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(),
+                                                           min,
+                                                           max,
+                                                           mean,
+                                                           min_color,
+                                                           max_color,
+                                                           mean_color ) );
                 }
             }
         }
@@ -272,6 +273,7 @@ public class MsaCompactor {
         config.setDisplaySequenceNames( false );
         config.setDisplaySequenceSymbols( false );
         config.setDisplayGeneNames( false );
+        config.setDisplayMultipleSequenceAlignment( true );
         config.setShowScale( true );
         config.setAddTaxonomyImagesCB( false );
         config.setBaseFontSize( 9 );
@@ -302,7 +304,7 @@ public class MsaCompactor {
     }
 
     public final List<MsaProperties> removeViaGapAverage( final double mean_gapiness ) throws IOException,
-            InterruptedException {
+    InterruptedException {
         final GapContribution stats[] = calcGapContribtionsStats( _norm );
         final List<String> to_remove_ids = new ArrayList<String>();
         final List<MsaProperties> msa_props = new ArrayList<MsaProperties>();
@@ -349,7 +351,14 @@ public class MsaCompactor {
         if ( _phylogentic_inference ) {
             decorateTree( phy, msa_props, false );
             displayTree( phy );
-        }
+            System.out.println( "calculating phylogentic tree..." );
+            System.out.println();
+            final Phylogeny phy2 = calcTree();
+            addSeqs2Tree( _msa, phy2 );
+            displayTree( phy2 );
+        }   
+      
+       
         return msa_props;
     }
 
@@ -400,12 +409,18 @@ public class MsaCompactor {
         if ( _phylogentic_inference ) {
             decorateTree( phy, msa_props, false );
             displayTree( phy );
-        }
+            System.out.println( "calculating phylogentic tree..." );
+            System.out.println();
+            final Phylogeny phy2 = calcTree();
+            addSeqs2Tree( _msa, phy2 );
+            displayTree( phy2 );
+        }   
+       
         return msa_props;
     }
 
     public final List<MsaProperties> removeWorstOffenders( final int to_remove ) throws IOException,
-            InterruptedException {
+    InterruptedException {
         final GapContribution stats[] = calcGapContribtionsStats( _norm );
         final List<String> to_remove_ids = new ArrayList<String>();
         final List<MsaProperties> msa_props = new ArrayList<MsaProperties>();
@@ -455,7 +470,8 @@ public class MsaCompactor {
             final Phylogeny phy2 = calcTree();
             addSeqs2Tree( _msa, phy2 );
             displayTree( phy2 );
-        }
+        }   
+       
         return msa_props;
     }
 
@@ -637,7 +653,7 @@ public class MsaCompactor {
         sb.append( "\t" );
         sb.append( NF_4.format( msa_properties.getGapRatio() ) );
         sb.append( "\t" );
-        sb.append( NF_1.format( msa_properties.getAvgNumberOfGapsPer100() ) );
+        sb.append( NF_1.format( msa_properties.getAvgNumberOfGaps() ) );
         if ( _calculate_shannon_entropy ) {
             sb.append( "\t" );
             sb.append( NF_4.format( msa_properties.getEntropy7() ) );