phylogenies = PhylogenyMethods.readPhylogenies( p, f );
if ( nhx_or_nexus && conf.isInternalNumberAreConfidenceForNhParsing() ) {
for( final Phylogeny phy : phylogenies ) {
- PhylogenyMethods.transferInternalNodeNamesToConfidence( phy );
+ PhylogenyMethods.transferInternalNodeNamesToConfidence( phy, "" );
}
}
}
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,
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;
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 );
- }
- }
+
}
}
}
- 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();
d = -1.0;
}
if ( d >= 0.0 ) {
- n.getBranchData().addConfidence( new Confidence( d, "" ) );
+ n.getBranchData().addConfidence( new Confidence( d, confidence_type ) );
n.setName( "" );
}
}