X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FAptxUtil.java;h=b874665d18f1a91f131c725e8475e649dce2e28a;hb=b43f94dd9ce1416a2459997d1a1b69cf81036684;hp=a615cb9d5bc43f228a634470cf1a5c17e113cc82;hpb=733f051a048f64b6850314a08880f1f77a633db8;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index a615cb9..b874665 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -75,6 +75,7 @@ import org.forester.io.parsers.tol.TolParser; import org.forester.io.parsers.util.ParserUtils; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; +import org.forester.phylogeny.PhylogenyMethods.DESCENDANT_SORT_PRIORITY; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Accession; import org.forester.phylogeny.data.BranchColor; @@ -794,9 +795,8 @@ public final class AptxUtil { desc.append( "\n" ); desc.append( " Median: " + ForesterUtil.round( bs.median(), 6 ) ); desc.append( "\n" ); - desc.append( " Mean: " + ForesterUtil.round( bs.arithmeticMean(), 6 ) ); - desc.append( "\n" ); - desc.append( " SD: " + ForesterUtil.round( bs.sampleStandardDeviation(), 6 ) ); + desc.append( " Mean: " + ForesterUtil.round( bs.arithmeticMean(), 6 ) + " (stdev: " + + ForesterUtil.round( bs.sampleStandardDeviation(), 6 ) + ")" ); desc.append( "\n" ); desc.append( " Minimum: " + ForesterUtil.round( bs.getMin(), 6 ) ); desc.append( "\n" ); @@ -815,9 +815,8 @@ public final class AptxUtil { desc.append( "\n" ); desc.append( " Median: " + ForesterUtil.round( ds.median(), 2 ) ); desc.append( "\n" ); - desc.append( " Mean: " + ForesterUtil.round( ds.arithmeticMean(), 2 ) ); - desc.append( "\n" ); - desc.append( " SD: " + ForesterUtil.round( ds.sampleStandardDeviation(), 2 ) ); + desc.append( " Mean: " + ForesterUtil.round( ds.arithmeticMean(), 2 ) + " (stdev: " + + ForesterUtil.round( ds.sampleStandardDeviation(), 2 ) + ")" ); desc.append( "\n" ); desc.append( " Minimum: " + ForesterUtil.roundToInt( ds.getMin() ) ); desc.append( "\n" ); @@ -852,11 +851,10 @@ public final class AptxUtil { desc.append( " Median: " + ForesterUtil.round( cs.median(), 6 ) ); desc.append( "\n" ); desc.append( " Mean: " + ForesterUtil.round( cs.arithmeticMean(), 6 ) ); - desc.append( "\n" ); if ( cs.getN() > 2 ) { - desc.append( " SD: " + ForesterUtil.round( cs.sampleStandardDeviation(), 6 ) ); - desc.append( "\n" ); + desc.append( " (stdev: " + ForesterUtil.round( cs.sampleStandardDeviation(), 6 ) + ")" ); } + desc.append( "\n" ); desc.append( " Minimum: " + ForesterUtil.roundToInt( cs.getMin() ) ); desc.append( "\n" ); desc.append( " Maximum: " + ForesterUtil.roundToInt( cs.getMax() ) ); @@ -920,17 +918,6 @@ public final class AptxUtil { return true; } - final static boolean isMac() { - try { - final String s = ForesterUtil.OS_NAME.toLowerCase(); - return s.startsWith( "mac" ); - } - catch ( final Exception e ) { - ForesterUtil.printWarningMessage( Constants.PRG_NAME, "minor error: " + e ); - return false; - } - } - final static boolean isUsOrCanada() { try { if ( ( Locale.getDefault().equals( Locale.CANADA ) ) || ( Locale.getDefault().equals( Locale.US ) ) ) { @@ -943,17 +930,6 @@ public final class AptxUtil { return false; } - final static boolean isWindows() { - try { - final String s = ForesterUtil.OS_NAME.toLowerCase(); - return s.indexOf( "win" ) > -1; - } - catch ( final Exception e ) { - ForesterUtil.printWarningMessage( Constants.PRG_NAME, "minor error: " + e ); - return false; - } - } - final static void lookAtSomeTreePropertiesForAptxControlSettings( final Phylogeny t, final ControlPanel atv_control, final Configuration configuration ) { @@ -1061,6 +1037,7 @@ public final class AptxUtil { if ( midpoint_reroot ) { for( final Phylogeny phy : phys ) { PhylogenyMethods.midpointRoot( phy ); + PhylogenyMethods.orderAppearance( phy.getRoot(), true, true, DESCENDANT_SORT_PRIORITY.NODE_NAME ); } } return phys; @@ -1298,7 +1275,7 @@ public final class AptxUtil { if ( os.toLowerCase().startsWith( "win" ) ) { Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + url ); } - else if ( isMac() ) { + else if ( ForesterUtil.isMac() ) { final Class file_mgr = Class.forName( "com.apple.eio.FileManager" ); final Method open_url = file_mgr.getDeclaredMethod( "openURL", new Class[] { String.class } ); open_url.invoke( null, new Object[] { url } );