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
JAL-244 Fix window size narrow adjustment not becoming a manual adjustment clash
[jalview.git]
/
src
/
jalview
/
ws
/
seqfetcher
/
ASequenceFetcher.java
diff --git
a/src/jalview/ws/seqfetcher/ASequenceFetcher.java
b/src/jalview/ws/seqfetcher/ASequenceFetcher.java
index
977f9da
..
0d0a314
100644
(file)
--- a/
src/jalview/ws/seqfetcher/ASequenceFetcher.java
+++ b/
src/jalview/ws/seqfetcher/ASequenceFetcher.java
@@
-21,7
+21,7
@@
package jalview.ws.seqfetcher;
import jalview.api.FeatureSettingsModelI;
package jalview.ws.seqfetcher;
import jalview.api.FeatureSettingsModelI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
@@
-112,7
+112,7
@@
public class ASequenceFetcher
return true;
}
}
return true;
}
}
- Cache.log.warn("isFetchable doesn't know about '" + source + "'");
+ Console.warn("isFetchable doesn't know about '" + source + "'");
return false;
}
return false;
}
@@
-126,15
+126,16
@@
public class ASequenceFetcher
*/
public SequenceI[] getSequences(List<DBRefEntry> refs, boolean dna)
{
*/
public SequenceI[] getSequences(List<DBRefEntry> refs, boolean dna)
{
- Vector<SequenceI> rseqs = new Vector<SequenceI>();
- Hashtable<String, List<String>> queries = new Hashtable<String, List<String>>();
+ Vector<SequenceI> rseqs = new Vector<>();
+ Hashtable<String, List<String>> queries = new Hashtable<>();
for (DBRefEntry ref : refs)
{
for (DBRefEntry ref : refs)
{
- if (!queries.containsKey(ref.getSource()))
+ String canonical = DBRefUtils.getCanonicalName(ref.getSource());
+ if (!queries.containsKey(canonical))
{
{
- queries.put(ref.getSource(), new ArrayList<String>());
+ queries.put(canonical, new ArrayList<String>());
}
}
- List<String> qset = queries.get(ref.getSource());
+ List<String> qset = queries.get(canonical);
if (!qset.contains(ref.getAccessionId()))
{
qset.add(ref.getAccessionId());
if (!qset.contains(ref.getAccessionId()))
{
qset.add(ref.getAccessionId());
@@
-154,14
+155,14
@@
public class ASequenceFetcher
continue;
}
continue;
}
- Stack<String> queriesLeft = new Stack<String>();
+ Stack<String> queriesLeft = new Stack<>();
queriesLeft.addAll(query);
List<DbSourceProxy> proxies = getSourceProxy(db);
for (DbSourceProxy fetcher : proxies)
{
queriesLeft.addAll(query);
List<DbSourceProxy> proxies = getSourceProxy(db);
for (DbSourceProxy fetcher : proxies)
{
- List<String> queriesMade = new ArrayList<String>();
- HashSet<String> queriesFound = new HashSet<String>();
+ List<String> queriesMade = new ArrayList<>();
+ HashSet<String> queriesFound = new HashSet<>();
try
{
if (fetcher.isDnaCoding() != dna)
try
{
if (fetcher.isDnaCoding() != dna)
@@
-204,9
+205,11
@@
public class ASequenceFetcher
for (int is = 0; is < seqs.length; is++)
{
rseqs.addElement(seqs[is]);
for (int is = 0; is < seqs.length; is++)
{
rseqs.addElement(seqs[is]);
+ // BH 2015.01.25 check about version/accessid being null here
List<DBRefEntry> frefs = DBRefUtils.searchRefs(
seqs[is].getDBRefs(),
List<DBRefEntry> frefs = DBRefUtils.searchRefs(
seqs[is].getDBRefs(),
- new DBRefEntry(db, null, null));
+ new DBRefEntry(db, null, null),
+ DBRefUtils.SEARCH_MODE_FULL);
for (DBRefEntry dbr : frefs)
{
queriesFound.add(dbr.getAccessionId());
for (DBRefEntry dbr : frefs)
{
queriesFound.add(dbr.getAccessionId());
@@
-306,13
+309,13
@@
public class ASequenceFetcher
Map<String, DbSourceProxy> dblist = fetchableDbs.get(db);
if (dblist == null)
{
Map<String, DbSourceProxy> dblist = fetchableDbs.get(db);
if (dblist == null)
{
- return new ArrayList<DbSourceProxy>();
+ return new ArrayList<>();
}
/*
* sort so that primary sources precede secondary
*/
}
/*
* sort so that primary sources precede secondary
*/
- List<DbSourceProxy> dbs = new ArrayList<DbSourceProxy>(dblist.values());
+ List<DbSourceProxy> dbs = new ArrayList<>(dblist.values());
Collections.sort(dbs, proxyComparator);
return dbs;
}
Collections.sort(dbs, proxyComparator);
return dbs;
}
@@
-357,14
+360,13
@@
public class ASequenceFetcher
{
if (fetchableDbs == null)
{
{
if (fetchableDbs == null)
{
- fetchableDbs = new Hashtable<String, Map<String, DbSourceProxy>>();
+ fetchableDbs = new Hashtable<>();
}
Map<String, DbSourceProxy> slist = fetchableDbs
.get(proxy.getDbSource());
if (slist == null)
{
}
Map<String, DbSourceProxy> slist = fetchableDbs
.get(proxy.getDbSource());
if (slist == null)
{
- fetchableDbs.put(proxy.getDbSource(),
- slist = new Hashtable<String, DbSourceProxy>());
+ fetchableDbs.put(proxy.getDbSource(), slist = new Hashtable<>());
}
slist.put(proxy.getDbName(), proxy);
}
}
slist.put(proxy.getDbName(), proxy);
}
@@
-391,7
+393,7
@@
public class ASequenceFetcher
return null;
}
String[] sources = null;
return null;
}
String[] sources = null;
- Vector<String> src = new Vector<String>();
+ Vector<String> src = new Vector<>();
Enumeration<String> dbs = fetchableDbs.keys();
while (dbs.hasMoreElements())
{
Enumeration<String> dbs = fetchableDbs.keys();
while (dbs.hasMoreElements())
{
@@
-413,7
+415,7
@@
public class ASequenceFetcher
public DbSourceProxy[] getDbSourceProxyInstances(Class class1)
{
public DbSourceProxy[] getDbSourceProxyInstances(Class class1)
{
- List<DbSourceProxy> prlist = new ArrayList<DbSourceProxy>();
+ List<DbSourceProxy> prlist = new ArrayList<>();
for (String fetchable : getSupportedDb())
{
for (DbSourceProxy pr : getSourceProxy(fetchable))
for (String fetchable : getSupportedDb())
{
for (DbSourceProxy pr : getSourceProxy(fetchable))