From da6babf1c977278c601bccab1e7747ed89996b52 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Thu, 7 Jun 2012 18:40:10 +0000 Subject: [PATCH] phylotastic hackathon at NESCENT 120607 --- .../forester/archaeopteryx/tools/SequenceDataRetriver.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/forester/java/src/org/forester/archaeopteryx/tools/SequenceDataRetriver.java b/forester/java/src/org/forester/archaeopteryx/tools/SequenceDataRetriver.java index ccef986..1ac188a 100644 --- a/forester/java/src/org/forester/archaeopteryx/tools/SequenceDataRetriver.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/SequenceDataRetriver.java @@ -142,7 +142,8 @@ public final class SequenceDataRetriver extends RunnableProcess { } } - public static SortedSet obtainSeqInformation( final Phylogeny phy, final boolean ext_nodes_only ) throws IOException { + public static SortedSet obtainSeqInformation( final Phylogeny phy, final boolean ext_nodes_only ) + throws IOException { final SortedSet not_found = new TreeSet(); for( final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter.hasNext(); ) { final PhylogenyNode node = iter.next(); @@ -183,11 +184,9 @@ public final class SequenceDataRetriver extends RunnableProcess { } } } - if ( db == Db.NONE ) { not_found.add( node.getName() ); } - SequenceDatabaseEntry db_entry = null; if ( !ForesterUtil.isEmpty( query ) ) { if ( db == Db.UNIPROT ) { @@ -212,7 +211,6 @@ public final class SequenceDataRetriver extends RunnableProcess { else if ( ( db == Db.NCBI ) && ( id != null ) ) { db_entry = SequenceDbWsTools.obtainEmblEntry( id, DEFAULT_LINES_TO_RETURN ); } - if ( ( db_entry != null ) && !db_entry.isEmpty() ) { if ( !ForesterUtil.isEmpty( db_entry.getAccession() ) ) { String type = null; @@ -248,6 +246,11 @@ public final class SequenceDataRetriver extends RunnableProcess { else if ( db != Db.NONE ) { not_found.add( node.getName() ); } + try { + Thread.sleep( 10 );// Sleep for 10 ms + } + catch ( final InterruptedException ie ) { + } } return not_found; } -- 1.7.10.2