X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FDasSequenceFeatureFetcher.java;h=7a001a94212283507ad9391d1011df1e8a5eb6b2;hb=89a0b775abfaa90242a171ca8133784a424a3d7b;hp=1e07c49193355b20a102badef959c46eddff0497;hpb=91c5d2144a780716e755e99882acffe46b40f18f;p=jalview.git diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index 1e07c49..7a001a9 100755 --- a/src/jalview/io/DasSequenceFeatureFetcher.java +++ b/src/jalview/io/DasSequenceFeatureFetcher.java @@ -27,7 +27,6 @@ import java.util.*; import java.net.URL; import org.biojava.dasobert.das.FeatureThread; -import org.biojava.dasobert.dasregistry.Das1Source; import org.biojava.dasobert.eventmodel.FeatureEvent; import org.biojava.dasobert.eventmodel.FeatureListener; import org.biojava.dasobert.dasregistry.DasSource; @@ -83,7 +82,6 @@ public class DasSequenceFeatureFetcher implements Runnable DasCoordinateSystem[] coords = source.getCoordinateSystem(); for (int c = 0; c < coords.length; c++) { - System.out.println(coords[c].getName()); if (coords[c].getName().indexOf("UniProt")>-1) { uniprotCount++; @@ -100,12 +98,9 @@ public class DasSequenceFeatureFetcher implements Runnable { for(int j=0; j0) { @@ -126,21 +120,38 @@ public class DasSequenceFeatureFetcher implements Runnable if(reply == JOptionPane.YES_OPTION) { - new DBRefFetcher( - af.getViewport().getAlignment(), af).fetchDBRefs(true); - + Thread thread = new Thread(new FetchDBRefs()); + thread.start(); } + else + startFetching(); } + else + startFetching(); - System.out.println("User selection is " - + + /* System.out.println("User selection is " + ( ( (float) uniprotCount / (float) selectedSources.size()) * 100) + " % Uniprot, and "+refCount+" / " +sequences.length+" have uniprot accession"); +*/ + } - + void startFetching() + { Thread thread = new Thread(this); thread.start(); } + + class FetchDBRefs implements Runnable + { + public void run() + { + new DBRefFetcher( + af.getViewport().getAlignment(), af).fetchDBRefs(true); + startFetching(); + } + } + + /** * creates a jalview sequence feature from a das feature document * @param dasfeature @@ -194,7 +205,6 @@ public class DasSequenceFeatureFetcher implements Runnable // null // ); - // System.out.println(nickname+" "+f.getType()+" "+f.begin+" "+f.end); return f; } catch (Exception e) { @@ -228,9 +238,8 @@ public class DasSequenceFeatureFetcher implements Runnable { setThreadsRunning(+1); - int start=seq.getStart(), end = seq.getEnd(); - - if(af.getViewport().getSelectionGroup()!=null) + // int start=seq.getStart(), end = seq.getEnd(); + /* if(af.getViewport().getSelectionGroup()!=null) { SequenceI tmp = af.getViewport().getAlignment().findName(seq.getName()); start = tmp.findPosition( @@ -240,7 +249,7 @@ public class DasSequenceFeatureFetcher implements Runnable end = tmp.findPosition( af.getViewport().getSelectionGroup().getEndRes() ); - } + }*/ FeatureThread fetcher = new FeatureThread(id // + ":" + start + "," + end, @@ -300,7 +309,12 @@ public class DasSequenceFeatureFetcher implements Runnable { threadsRunning += i; if(threadsRunning<1) + { af.setProgressBar("DAS Feature Fetching Complete", startTime); + + if(af.featureSettings!=null) + af.featureSettings.setTableData(); + } } /** @@ -361,7 +375,7 @@ public class DasSequenceFeatureFetcher implements Runnable { // Will have to pass any mapping information to the fetcher - the start/end for the DBRefEntry may not be the same as the sequence's start/end - org.biojava.dasobert.dasregistry.DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); + DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); for (int l=0; l