From: cmzmasek Date: Mon, 7 Apr 2014 04:03:46 +0000 (+0000) Subject: in progress X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b6994b4fd04614be576f79b6df6ea39235e7cfd2;p=jalview.git in progress --- diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index 14cb729..73c2c4f 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -712,7 +712,7 @@ public final class AptxUtil { if ( phys != null ) { if ( nhx_or_nexus && internal_numbers_are_confidences ) { for( final Phylogeny phy : phys ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } } if ( midpoint_reroot ) { diff --git a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java index c23dcca..a15ef51 100644 --- a/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java +++ b/forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java @@ -102,7 +102,7 @@ public final class Archaeopteryx { phylogenies = PhylogenyMethods.readPhylogenies( p, f ); if ( nhx_or_nexus && conf.isInternalNumberAreConfidenceForNhParsing() ) { for( final Phylogeny phy : phylogenies ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } } } diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 4b860a1..6ae6a95 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -1223,7 +1223,7 @@ public final class MainFrameApplication extends MainFrame { if ( ( phys != null ) && ( phys.length > 0 ) ) { if ( nhx_or_nexus && getOptions().isInternalNumberAreConfidenceForNhParsing() ) { for( final Phylogeny phy : phys ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } } AptxUtil.addPhylogeniesToTabs( phys, @@ -2189,7 +2189,7 @@ public final class MainFrameApplication extends MainFrame { if ( nhx_or_nexus ) { for( final Phylogeny phy : phys ) { if ( getOptions().isInternalNumberAreConfidenceForNhParsing() ) { - PhylogenyMethods.transferInternalNodeNamesToConfidence( phy ); + PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" ); } if ( PhylogenyMethods.getMinimumDescendentsPerInternalNodes( phy ) == 1 ) { one_desc = true; diff --git a/forester/java/src/org/forester/archaeopteryx/webservices/WebserviceUtil.java b/forester/java/src/org/forester/archaeopteryx/webservices/WebserviceUtil.java index 58fb1e0..18bc84f 100644 --- a/forester/java/src/org/forester/archaeopteryx/webservices/WebserviceUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/webservices/WebserviceUtil.java @@ -126,31 +126,29 @@ public final class WebserviceUtil { public static void processInstructions( final PhylogeniesWebserviceClient client, final Phylogeny phylogeny ) throws PhyloXmlDataFormatException { if ( client.getProcessingInstructions().equals( WebserviceUtil.TREE_FAM_INST ) ) { - WebserviceUtil.removeEventsInExternalNodes( phylogeny ); - WebserviceUtil.setTaxonomyIdentifierType( phylogeny, "ncbi" ); + + WebserviceUtil.processTreeFamTrees( phylogeny ); } else if ( client.getProcessingInstructions().equals( WebserviceUtil.PFAM_INST ) ) { WebserviceUtil.extractSpTremblAccFromNodeName( phylogeny, "sptrembl" ); - } + PhylogenyMethods.transferInternalNodeNamesToConfidence( phylogeny, "bootstrap" ); } } - static void setTaxonomyIdentifierType( final Phylogeny phy, final String type ) { + static void processTreeFamTrees( final Phylogeny phy ) { final PhylogenyNodeIterator it = phy.iteratorPostorder(); while ( it.hasNext() ) { final PhylogenyNode n = it.next(); + if ( n.isExternal() ) { + n.getNodeData().setEvent( null ); + } + if ( n.getNodeData().isHasTaxonomy() && ( n.getNodeData().getTaxonomy().getIdentifier() != null ) ) { n.getNodeData() .getTaxonomy() - .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(), type ) ); + .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(), "ncbi" ) ); } } } - static void removeEventsInExternalNodes( final Phylogeny phy ) { - final PhylogenyNodeIterator it = phy.iteratorExternalForward(); - while ( it.hasNext() ) { - final PhylogenyNode n = it.next(); - n.getNodeData().setEvent( null ); - } - } + } diff --git a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java index 806f031..1f872cf 100644 --- a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java +++ b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java @@ -1516,7 +1516,7 @@ public class PhylogenyMethods { } } - final static public void transferInternalNodeNamesToConfidence( final Phylogeny phy ) { + final static public void transferInternalNodeNamesToConfidence( final Phylogeny phy, final String confidence_type ) { final PhylogenyNodeIterator it = phy.iteratorPostorder(); while ( it.hasNext() ) { final PhylogenyNode n = it.next(); @@ -1530,7 +1530,7 @@ public class PhylogenyMethods { d = -1.0; } if ( d >= 0.0 ) { - n.getBranchData().addConfidence( new Confidence( d, "" ) ); + n.getBranchData().addConfidence( new Confidence( d, confidence_type ) ); n.setName( "" ); } }