X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FAptxUtil.java;h=89a0cdab49e0065fe99c7c56c7d4711ad2b2c8e8;hb=a3ab1c26605a4ffaaa5e8fd0927250c53c884bf9;hp=8ccd0280c99b86609427c41d2630f622d530cd09;hpb=64dc04c28918adc0b9b3752cdccd3df1c8c4cb92;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index 8ccd028..89a0cda 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; @@ -150,6 +151,18 @@ public final class AptxUtil { } } } + if ( ForesterUtil.isEmpty( uri_str ) ) { + final String v = ForesterUtil.extractGInumber( node ); + if ( !ForesterUtil.isEmpty( v ) ) { + try { + uri_str = ForesterUtil.NCBI_GI + URLEncoder.encode( v, ForesterConstants.UTF8 ); + } + catch ( final UnsupportedEncodingException e ) { + showErrorMessage( tp, e.toString() ); + e.printStackTrace(); + } + } + } return uri_str; } @@ -1015,8 +1028,9 @@ public final class AptxUtil { final boolean phyloxml_validate_against_xsd, final boolean replace_underscores, final boolean internal_numbers_are_confidences, - final TAXONOMY_EXTRACTION taxonomy_extraction ) - throws FileNotFoundException, IOException { + final TAXONOMY_EXTRACTION taxonomy_extraction, + final boolean midpoint_reroot ) throws FileNotFoundException, + IOException { final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance(); final PhylogenyParser parser; boolean nhx_or_nexus = false; @@ -1045,6 +1059,12 @@ public final class AptxUtil { 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 ); + } + } return phys; }