remove single node root
[jalview.git] / forester / java / src / org / forester / application / rio.java
index 065b676..98fd473 100644 (file)
@@ -47,7 +47,7 @@ public class rio {
 
     final static private String PRG_NAME      = "rio";
     final static private String PRG_VERSION   = "4.000 beta 3";
-    final static private String PRG_DATE      = "2012.12.18";
+    final static private String PRG_DATE      = "2012.12.19";
     final static private String E_MAIL        = "czmasek@burnham.org";
     final static private String WWW           = "www.phylosoft.org/forester/";
     final static private String HELP_OPTION_1 = "help";
@@ -283,12 +283,18 @@ public class rio {
             final BasicDescriptiveStatistics stats = rio.getDuplicationsStatistics();
             final java.text.DecimalFormat df = new java.text.DecimalFormat( "0.#" );
             System.out.println( "Mean number of duplications  : " + df.format( stats.arithmeticMean() ) + " (sd: "
-                    + df.format( stats.sampleStandardDeviation() ) + ")" );
+                    + df.format( stats.sampleStandardDeviation() ) + ") ("
+                    + df.format( 100.0 * stats.arithmeticMean() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" );
             if ( stats.getN() > 3 ) {
-                System.out.println( "Median number of duplications: " + df.format( stats.median() ) );
+                System.out.println( "Median number of duplications: " + df.format( stats.median() ) + " ("
+                        + df.format( 100.0 * stats.median() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" );
             }
-            System.out.println( "Minimum duplications         : " + ( int ) stats.getMin() );
-            System.out.println( "Maximum duplications         : " + ( int ) stats.getMax() );
+            System.out.println( "Minimum duplications         : " + ( int ) stats.getMin() + " ("
+                    + df.format( 100.0 * stats.getMin() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" );
+            System.out.println( "Maximum duplications         : " + ( int ) stats.getMax() + " ("
+                    + df.format( 100.0 * stats.getMax() / rio.getIntNodesOfAnalyzedGeneTrees() ) + "%)" );
+            System.out.println( "Gene tree internal nodes     : " + rio.getIntNodesOfAnalyzedGeneTrees() );
+            System.out.println( "Gene tree external nodes     : " + rio.getExtNodesOfAnalyzedGeneTrees() );
         }
         catch ( final RIOException e ) {
             ForesterUtil.fatalError( e.getLocalizedMessage() );
@@ -299,9 +305,15 @@ public class rio {
         catch ( final IOException e ) {
             ForesterUtil.fatalError( e.getLocalizedMessage() );
         }
+        catch ( final OutOfMemoryError e ) {
+            ForesterUtil.outOfMemoryError( e );
+        }
         catch ( final Exception e ) {
             ForesterUtil.unexpectedFatalError( e );
         }
+        catch ( final Error e ) {
+            ForesterUtil.unexpectedFatalError( e );
+        }
         time = System.currentTimeMillis() - time;
         System.out.println( "Time: " + time + "ms" );
         System.out.println( "OK" );
@@ -328,11 +340,13 @@ public class rio {
         System.out.println( "                   disallowed, as are most options)" );
         System.out.println();
         System.out.println( " Formats" );
-        System.out.println( "  The species tree is expected to be in phyloXML format." );
         System.out
-                .println( "  The gene trees ideally are in phyloXML as well, but can also be in New Hamphshire (Newick)" );
-        System.out.println( "  or Nexus format as long as species information can be extracted from the gene names" );
-        System.out.println( "  (e.g. \"HUMAN\" from \"BCL2_HUMAN\")." );
+                .println( "  The gene trees, as well as the species tree, ideally are in phyloXML (www.phyloxml.org) format," );
+        System.out
+                .println( "  but can also be in New Hamphshire (Newick) or Nexus format as long as species information can be" );
+        System.out
+                .println( "  extracted from the gene names (e.g. \"HUMAN\" from \"BCL2_HUMAN\") and matched to a single species" );
+        System.out.println( "  in the species tree." );
         System.out.println();
         System.out.println( " Examples" );
         System.out.println( "  \"rio gene_trees.nh species.xml outtable.tsv log.txt\"" );