git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f18e937
)
Not using AxisDasRegistry
author
amwaterhouse
<Andrew Waterhouse>
Thu, 15 Jun 2006 14:06:00 +0000
(14:06 +0000)
committer
amwaterhouse
<Andrew Waterhouse>
Thu, 15 Jun 2006 14:06:00 +0000
(14:06 +0000)
src/jalview/io/DasSequenceFeatureFetcher.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/DasSequenceFeatureFetcher.java
b/src/jalview/io/DasSequenceFeatureFetcher.java
index
9dd2d1e
..
0c9681a
100755
(executable)
--- a/
src/jalview/io/DasSequenceFeatureFetcher.java
+++ b/
src/jalview/io/DasSequenceFeatureFetcher.java
@@
-30,8
+30,13
@@
import org.biojava.dasobert.das.FeatureThread;
import org.biojava.dasobert.dasregistry.Das1Source;
\r
import org.biojava.dasobert.eventmodel.FeatureEvent;
\r
import org.biojava.dasobert.eventmodel.FeatureListener;
\r
import org.biojava.dasobert.dasregistry.Das1Source;
\r
import org.biojava.dasobert.eventmodel.FeatureEvent;
\r
import org.biojava.dasobert.eventmodel.FeatureListener;
\r
-import org.biojava.services.das.registry.DasRegistryAxisClient;
\r
-import org.biojava.services.das.registry.DasSource;
\r
+import org.biojava.dasobert.dasregistry.DasSource;
\r
+
\r
+import org.biojava.dasobert.das2.io.DasSourceReaderImpl;
\r
+import org.biojava.dasobert.dasregistry.Das1Source;
\r
+import org.biojava.dasobert.dasregistry.DasSource;
\r
+import org.biojava.dasobert.das2.Das2Source;
\r
+import org.biojava.dasobert.das2.DasSourceConverter;
\r
\r
\r
import jalview.bin.Cache;
\r
\r
\r
import jalview.bin.Cache;
\r
@@
-246,7
+251,7
@@
public class DasSequenceFeatureFetcher implements Runnable
for (int j = 0, k = uprefs.size(); j < k; j++)
\r
{
\r
// 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
\r
for (int j = 0, k = uprefs.size(); j < k; j++)
\r
{
\r
// 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
\r
- org.biojava.services.das.registry.DasCoordinateSystem cs[] = dasSource.getCoordinateSystem();
\r
+ org.biojava.dasobert.dasregistry.DasCoordinateSystem cs[] = dasSource.getCoordinateSystem();
\r
for (int l=0; l<cs.length; l++) {
\r
if (jalview.util.DBRefUtils.isDasCoordinateSystem(cs[l].getName(), (DBRefEntry)
\r
uprefs.get(j)))
\r
for (int l=0; l<cs.length; l++) {
\r
if (jalview.util.DBRefUtils.isDasCoordinateSystem(cs[l].getName(), (DBRefEntry)
\r
uprefs.get(j)))
\r
@@
-296,27
+301,47
@@
public class DasSequenceFeatureFetcher implements Runnable
}
\r
\r
\r
}
\r
\r
\r
- public static DasSource[] getDASSources()
\r
+ public static DasSource[] getDASSources()
\r
{
\r
{
\r
- try
\r
- {
\r
- String registryURL = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
\r
- "http://servlet.sanger.ac.uk/dasregistry/services/das_registry");
\r
+ DasSourceReaderImpl reader = new DasSourceReaderImpl();
\r
\r
\r
+ String registryURL = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
\r
+ "http://servlet.sanger.ac.uk/dasregistry/services/das_registry");
\r
\r
\r
+ try
\r
+ {
\r
URL url = new URL(registryURL);
\r
\r
URL url = new URL(registryURL);
\r
\r
- DasRegistryAxisClient client = new DasRegistryAxisClient(url);
\r
+ DasSource[] sources = reader.readDasSource(url);
\r
\r
\r
- DasSource[] services = client.listServices();
\r
+ List das1sources = new ArrayList();
\r
+ for (int i = 0; i < sources.length; i++)
\r
+ {
\r
+ DasSource ds = sources[i];
\r
+ if (ds instanceof Das2Source)
\r
+ {
\r
+ Das2Source d2s = (Das2Source) ds;
\r
+ if (d2s.hasDas1Capabilities())
\r
+ {
\r
+ Das1Source d1s = DasSourceConverter.toDas1Source(d2s);
\r
+ das1sources.add(d1s);
\r
+ }
\r
+
\r
+ //
\r
+ }
\r
+ else if (ds instanceof Das1Source)
\r
+ {
\r
+ das1sources.add( (Das1Source) ds);
\r
+ }
\r
+ }
\r
\r
\r
- return services;
\r
+ return (Das1Source[]) das1sources.toArray(new Das1Source[das1sources.size()]);
\r
}
\r
catch (Exception ex)
\r
{
\r
ex.printStackTrace();
\r
}
\r
catch (Exception ex)
\r
{
\r
ex.printStackTrace();
\r
+ return null;
\r
}
\r
}
\r
- return null;
\r
\r
}
\r
}
\r
\r
}
\r
}
\r