git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
applet gsdi
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
analysis
/
TaxonomyDataManager.java
diff --git
a/forester/java/src/org/forester/analysis/TaxonomyDataManager.java
b/forester/java/src/org/forester/analysis/TaxonomyDataManager.java
index
15d58a2
..
cddaa4f
100644
(file)
--- 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
// 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;
package org.forester.analysis;
@@
-38,6
+38,7
@@
import javax.swing.JOptionPane;
import org.forester.archaeopteryx.MainFrameApplication;
import org.forester.archaeopteryx.TreePanel;
import org.forester.archaeopteryx.MainFrameApplication;
import org.forester.archaeopteryx.TreePanel;
+import org.forester.archaeopteryx.tools.AncestralTaxonomyInferrer;
import org.forester.archaeopteryx.tools.RunnableProcess;
import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException;
import org.forester.phylogeny.Phylogeny;
import org.forester.archaeopteryx.tools.RunnableProcess;
import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException;
import org.forester.phylogeny.Phylogeny;
@@
-46,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.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.UniProtWsTools;
+import org.forester.ws.seqdb.SequenceDbWsTools;
+import org.forester.ws.seqdb.UniProtTaxonomy;
public final class TaxonomyDataManager extends RunnableProcess {
public final class TaxonomyDataManager extends RunnableProcess {
@@
-175,19
+176,19
@@
public final class TaxonomyDataManager extends RunnableProcess {
}
private final static List<UniProtTaxonomy> getTaxonomiesFromCommonName( final String query ) throws IOException {
}
private final static List<UniProtTaxonomy> getTaxonomiesFromCommonName( final String query ) throws IOException {
- return UniProtWsTools.getTaxonomiesFromCommonNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
+ return SequenceDbWsTools.getTaxonomiesFromCommonNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
}
private final static List<UniProtTaxonomy> getTaxonomiesFromId( final String query ) throws IOException {
}
private final static List<UniProtTaxonomy> getTaxonomiesFromId( final String query ) throws IOException {
- return UniProtWsTools.getTaxonomiesFromId( query, MAX_TAXONOMIES_TO_RETURN );
+ return SequenceDbWsTools.getTaxonomiesFromId( query, MAX_TAXONOMIES_TO_RETURN );
}
private final static List<UniProtTaxonomy> getTaxonomiesFromScientificName( final String query ) throws IOException {
}
private final static List<UniProtTaxonomy> getTaxonomiesFromScientificName( final String query ) throws IOException {
- return UniProtWsTools.getTaxonomiesFromScientificNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
+ return SequenceDbWsTools.getTaxonomiesFromScientificNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
}
private final static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String query ) throws IOException {
}
private final static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String query ) throws IOException {
- return UniProtWsTools.getTaxonomiesFromTaxonomyCode( query, MAX_TAXONOMIES_TO_RETURN );
+ return SequenceDbWsTools.getTaxonomiesFromTaxonomyCode( query, MAX_TAXONOMIES_TO_RETURN );
}
static final boolean isHasAppropriateId( final Taxonomy tax ) {
}
static final boolean isHasAppropriateId( final Taxonomy tax ) {
@@
-242,6
+243,7
@@
public final class TaxonomyDataManager extends RunnableProcess {
if ( tax == null ) {
tax = new Taxonomy();
node.getNodeData().addTaxonomy( tax );
if ( tax == null ) {
tax = new Taxonomy();
node.getNodeData().addTaxonomy( tax );
+ node.setName( "" );
}
updateTaxonomy( qt, node, tax, uniprot_tax );
}
}
updateTaxonomy( qt, node, tax, uniprot_tax );
}
@@
-250,7
+252,7
@@
public final class TaxonomyDataManager extends RunnableProcess {
not_found.add( tax.toString() );
}
else {
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 );
}
if ( delete && node.isExternal() ) {
not_found_external_nodes.add( node );
@@
-263,7
+265,7
@@
public final class TaxonomyDataManager extends RunnableProcess {
phy.deleteSubtree( node, true );
}
phy.externalNodesHaveChanged();
phy.deleteSubtree( node, true );
}
phy.externalNodesHaveChanged();
- phy.hashIDs();
+ phy.clearHashIdToNodeMap();
phy.recalculateNumberOfExternalDescendants( true );
}
return not_found;
phy.recalculateNumberOfExternalDescendants( true );
}
return not_found;
@@
-335,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 ) {
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 ) {
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" );
}
throw new AncestralTaxonomyInferenceException( "lineage \""
+ ForesterUtil.stringListToString( lineage, " > " ) + "\" is not unique" );
}
@@
-373,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,
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() );
if ( ( qt != QUERY_TYPE.SN ) && !ForesterUtil.isEmpty( up_tax.getScientificName() )
&& ForesterUtil.isEmpty( tax.getScientificName() ) ) {
tax.setScientificName( up_tax.getScientificName() );
@@
-520,7
+525,7
@@
public final class TaxonomyDataManager extends RunnableProcess {
}
private final String getBaseUrl() {
}
private final String getBaseUrl() {
- return UniProtWsTools.BASE_URL;
+ return AncestralTaxonomyInferrer.getBaseUrl();
}
@Override
}
@Override