X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FAptxUtil.java;h=14cb7299896d2f4a26508aef74038a8a289839a5;hb=7359853f540f8d2704930c90e0ea9b6969bde51b;hp=42e7ab1113067843e2b476eb6bcb67efbe5c2be9;hpb=7bbb45295594e9574ee64a32fac17a93b5aa6ade;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index 42e7ab1..14cb729 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -397,9 +397,23 @@ public final class AptxUtil { return iter.hasNext(); } - final static String createBasicInformation( final Phylogeny phy ) { + final static String createBasicInformation( final Phylogeny phy, final File treefile ) { final StringBuilder desc = new StringBuilder(); if ( ( phy != null ) && !phy.isEmpty() ) { + String f = null; + if ( treefile != null ) { + try { + f = treefile.getCanonicalPath(); + } + catch ( final IOException e ) { + //Not important, ignore. + } + if ( !ForesterUtil.isEmpty( f ) ) { + desc.append( "Path: " ); + desc.append( f ); + desc.append( "\n" ); + } + } if ( !ForesterUtil.isEmpty( phy.getName() ) ) { desc.append( "Name: " ); desc.append( phy.getName() ); @@ -488,10 +502,10 @@ public final class AptxUtil { desc.append( "\n" ); desc.append( "Descendants per node statistics: " ); desc.append( "\n" ); - desc.append( " Median: " + ForesterUtil.round( ds.median(), 2 ) ); + desc.append( " Median: " + ForesterUtil.round( ds.median(), 6 ) ); desc.append( "\n" ); - desc.append( " Mean: " + ForesterUtil.round( ds.arithmeticMean(), 2 ) + " (stdev: " - + ForesterUtil.round( ds.sampleStandardDeviation(), 2 ) + ")" ); + desc.append( " Mean: " + ForesterUtil.round( ds.arithmeticMean(), 6 ) + " (stdev: " + + ForesterUtil.round( ds.sampleStandardDeviation(), 6 ) + ")" ); desc.append( "\n" ); desc.append( " Minimum: " + ForesterUtil.roundToInt( ds.getMin() ) ); desc.append( "\n" ); @@ -530,9 +544,9 @@ public final class AptxUtil { desc.append( " (stdev: " + ForesterUtil.round( cs.sampleStandardDeviation(), 6 ) + ")" ); } desc.append( "\n" ); - desc.append( " Minimum: " + ForesterUtil.roundToInt( cs.getMin() ) ); + desc.append( " Minimum: " + ForesterUtil.round( cs.getMin(), 6 ) ); desc.append( "\n" ); - desc.append( " Maximum: " + ForesterUtil.roundToInt( cs.getMax() ) ); + desc.append( " Maximum: " + ForesterUtil.round( cs.getMax(), 6 ) ); desc.append( "\n" ); } } @@ -693,16 +707,19 @@ public final class AptxUtil { nex.setIgnoreQuotes( false ); } } + AptxUtil.printAppletMessage( "Archaeopteryx", "parser is " + parser.getName() ); final Phylogeny[] phys = factory.create( url.openStream(), parser ); - if ( nhx_or_nexus && internal_numbers_are_confidences ) { - for( final Phylogeny phy : phys ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + if ( phys != null ) { + if ( nhx_or_nexus && internal_numbers_are_confidences ) { + for( final Phylogeny phy : phys ) { + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + } } - } - if ( midpoint_reroot ) { - for( final Phylogeny phy : phys ) { - PhylogenyMethods.midpointRoot( phy ); - PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME ); + if ( midpoint_reroot ) { + for( final Phylogeny phy : phys ) { + PhylogenyMethods.midpointRoot( phy ); + PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME ); + } } } return phys;