remove single node root
[jalview.git] / forester / java / src / org / forester / rio / TestRIO.java
index 06468af..81d2db2 100644 (file)
@@ -8,6 +8,7 @@ import org.forester.phylogeny.PhylogenyMethods;
 import org.forester.phylogeny.PhylogenyMethods.PhylogenyNodeField;
 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
 import org.forester.phylogeny.factories.PhylogenyFactory;
+import org.forester.rio.RIO.REROOTING;
 import org.forester.sdi.SDIutil.ALGORITHM;
 import org.forester.sdi.SDIutil.TaxonomyComparisonBase;
 import org.forester.util.ForesterUtil;
@@ -17,6 +18,15 @@ public final class TestRIO {
     private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" ) + ForesterUtil.getFileSeparator()
                                                           + "test_data" + ForesterUtil.getFileSeparator();
 
+    public static void main( final String[] args ) {
+        if ( !testRIO_GSDIR() ) {
+            System.out.println( "testRIO GSDIR failed" );
+        }
+        else {
+            System.out.println( "OK" );
+        }
+    }
+
     public static boolean test() {
         if ( !testRIO_GSDIR() ) {
             return false;
@@ -40,7 +50,13 @@ public final class TestRIO {
             species_tree_1.setRooted( true );
             PhylogenyMethods.transferNodeNameToField( species_tree_1, PhylogenyNodeField.TAXONOMY_CODE, true );
             //Archaeopteryx.createApplication( species_trees_1 );
-            RIO rio = new RIO( gene_trees_1, species_tree_1, ALGORITHM.GSDIR, true, false );
+            RIO rio = RIO.executeAnalysis( gene_trees_1,
+                                           species_tree_1,
+                                           ALGORITHM.GSDIR,
+                                           REROOTING.BY_ALGORITHM,
+                                           "",
+                                           true,
+                                           false );
             if ( rio.getAnalyzedGeneTrees().length != 5 ) {
                 return false;
             }
@@ -79,7 +95,7 @@ public final class TestRIO {
             final Phylogeny species_tree_2 = factory.create( species_trees_2_str, new NHXParser() )[ 0 ];
             species_tree_2.setRooted( true );
             PhylogenyMethods.transferNodeNameToField( species_tree_2, PhylogenyNodeField.TAXONOMY_CODE, true );
-            rio = new RIO( gene_trees_2, species_tree_2, ALGORITHM.GSDIR, true, false );
+            rio = RIO.executeAnalysis( gene_trees_2, species_tree_2 );
             m = RIO.calculateOrthologTable( rio.getAnalyzedGeneTrees(), true );
             // System.out.println( m.toString() );
             if ( !m.getRowAsString( 0, ',' ).equals( "ARATH,5,5,5,5,5,5" ) ) {
@@ -107,13 +123,4 @@ public final class TestRIO {
         }
         return true;
     }
-
-    public static void main( final String[] args ) {
-        if ( !testRIO_GSDIR() ) {
-            System.out.println( "testRIO GSDIR failed" );
-        }
-        else {
-            System.out.println( "OK" );
-        }
-    }
 }
\ No newline at end of file