X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fanalysis%2FTaxonomyDataManager.java;h=cddaa4f832670674e13e3da7f630ba67d650a18d;hb=663daba455e534e015bd56bae070e9248e3a4533;hp=99c1de1dd832aec77e6a750c0cd8442803837420;hpb=32b66090883b7ca47347fef19152d84bd02c0b9d;p=jalview.git diff --git a/forester/java/src/org/forester/analysis/TaxonomyDataManager.java b/forester/java/src/org/forester/analysis/TaxonomyDataManager.java index 99c1de1..cddaa4f 100644 --- a/forester/java/src/org/forester/analysis/TaxonomyDataManager.java +++ b/forester/java/src/org/forester/analysis/TaxonomyDataManager.java @@ -22,7 +22,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.analysis; @@ -47,8 +47,8 @@ import org.forester.phylogeny.data.Identifier; import org.forester.phylogeny.data.Taxonomy; import org.forester.phylogeny.iterators.PhylogenyNodeIterator; import org.forester.util.ForesterUtil; -import org.forester.ws.uniprot.UniProtTaxonomy; -import org.forester.ws.uniprot.SequenceDbWsTools; +import org.forester.ws.seqdb.SequenceDbWsTools; +import org.forester.ws.seqdb.UniProtTaxonomy; public final class TaxonomyDataManager extends RunnableProcess { @@ -252,7 +252,7 @@ public final class TaxonomyDataManager extends RunnableProcess { not_found.add( tax.toString() ); } else { - not_found.add(node.getName() ); + not_found.add( node.getName() ); } if ( delete && node.isExternal() ) { not_found_external_nodes.add( node ); @@ -265,7 +265,7 @@ public final class TaxonomyDataManager extends RunnableProcess { phy.deleteSubtree( node, true ); } phy.externalNodesHaveChanged(); - phy.hashIDs(); + phy.clearHashIdToNodeMap(); phy.recalculateNumberOfExternalDescendants( true ); } return not_found; @@ -337,13 +337,15 @@ public final class TaxonomyDataManager extends RunnableProcess { for( final UniProtTaxonomy up_taxonomy : up_taxonomies ) { boolean match = true; I: for( int i = 0; i < lineage.size(); ++i ) { - if ( !lineage.get( i ).equalsIgnoreCase( up_taxonomy.getLineage().get( i ) ) ) { + if ( ( i == up_taxonomy.getLineage().size() ) + || !lineage.get( i ).equalsIgnoreCase( up_taxonomy.getLineage().get( i ) ) ) { match = false; break I; } } if ( match ) { if ( up_tax != null ) { + //TODO this is dead code?! throw new AncestralTaxonomyInferenceException( "lineage \"" + ForesterUtil.stringListToString( lineage, " > " ) + "\" is not unique" ); } @@ -375,7 +377,8 @@ public final class TaxonomyDataManager extends RunnableProcess { synchronized final private static void updateTaxonomy( final QUERY_TYPE qt, final PhylogenyNode node, final Taxonomy tax, - final UniProtTaxonomy up_tax ) { + final UniProtTaxonomy up_tax ) + throws PhyloXmlDataFormatException { if ( ( qt != QUERY_TYPE.SN ) && !ForesterUtil.isEmpty( up_tax.getScientificName() ) && ForesterUtil.isEmpty( tax.getScientificName() ) ) { tax.setScientificName( up_tax.getScientificName() );