version 0.9910 beta
[jalview.git] / forester / java / src / org / forester / evoinference / TestPhylogenyReconstruction.java
index 71f418a..f1074f4 100644 (file)
@@ -34,7 +34,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Set;
 
-import org.forester.archaeopteryx.Archaeopteryx;
 import org.forester.evoinference.distance.NeighborJoining;
 import org.forester.evoinference.distance.NeighborJoiningF;
 import org.forester.evoinference.distance.NeighborJoiningR;
@@ -60,7 +59,8 @@ import org.forester.util.ForesterUtil;
 
 public class TestPhylogenyReconstruction {
 
-    private final static double ZERO_DIFF = 1.0E-9;
+    private final static double  ZERO_DIFF = 1.0E-9;
+    private final static boolean VERBOSE   = false;
 
     public static boolean isEqual( final double a, final double b ) {
         return ( ( Math.abs( a - b ) ) < ZERO_DIFF );
@@ -72,7 +72,7 @@ public class TestPhylogenyReconstruction {
 
     public static void main( final String[] args ) {
         System.out.println( "NJ" );
-        if ( testNeighborJoining() ) {
+        if ( testNeighborJoining( VERBOSE ) ) {
             System.out.println( "  OK." );
         }
         else {
@@ -134,7 +134,7 @@ public class TestPhylogenyReconstruction {
         }
         System.out.println( "OK." );
         System.out.print( "  Neighbor Joining: " );
-        if ( !testNeighborJoining() ) {
+        if ( !testNeighborJoining( VERBOSE ) ) {
             System.out.println( "failed." );
             return false;
         }
@@ -1953,7 +1953,7 @@ public class TestPhylogenyReconstruction {
         return true;
     }
 
-    private static boolean testNeighborJoining() {
+    private static boolean testNeighborJoining( final boolean verbose ) {
         try {
             NeighborJoining nj = NeighborJoining.createInstance();
             final BasicSymmetricalDistanceMatrix m0 = new BasicSymmetricalDistanceMatrix( 4 );
@@ -2080,9 +2080,9 @@ public class TestPhylogenyReconstruction {
             m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
             m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
             //NeighborJoiningR njr = NeighborJoiningR.createInstance( true, 6 );
-            nj = NeighborJoining.createInstance( true, 6 );
+            nj = NeighborJoining.createInstance( verbose, 6 );
             final Phylogeny p2 = nj.execute( m );
-            Archaeopteryx.createApplication( p2 );
+            //Archaeopteryx.createApplication( p2 );
             p2.reRoot( p2.getNode( "Bovine" ) );
             if ( isUnequal( p2.getNode( "Chimp" ).getDistanceToParent(), 0.151675 ) ) {
                 return false;
@@ -2200,7 +2200,7 @@ public class TestPhylogenyReconstruction {
             m.setRow( "1.52430 1.44650 0.59580 0.46310 0.00000 0.34840 0.30830", 4 );
             m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
             m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
-            njf = NeighborJoiningF.createInstance( true, 5 );
+            njf = NeighborJoiningF.createInstance( verbose, 5 );
             final Phylogeny p2f = njf.execute( m );
             p2f.reRoot( p2f.getNode( "Bovine" ) );
             if ( isUnequal( p2f.getNode( "Chimp" ).getDistanceToParent(), 0.15168 ) ) {
@@ -2629,7 +2629,7 @@ public class TestPhylogenyReconstruction {
             m2.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
             final NeighborJoiningR nj2 = NeighborJoiningR.createInstance( true, 6 );
             final Phylogeny p2 = nj2.execute( m2 );
-            Archaeopteryx.createApplication( p2 );
+            // Archaeopteryx.createApplication( p2 );
             p2.reRoot( p2.getNode( "Bovine" ) );
             if ( isUnequal( p2.getNode( "Chimp" ).getDistanceToParent(), 0.151675 ) ) {
                 System.out.println( p2.getNode( "Chimp" ).getDistanceToParent() );