JAL-2681 canonicalise DB source before fetching to avoid fetching the same ref !
authorJim Procter <jprocter@issues.jalview.org>
Tue, 22 Aug 2017 21:10:27 +0000 (22:10 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 22 Aug 2017 21:10:27 +0000 (22:10 +0100)
src/jalview/ws/seqfetcher/ASequenceFetcher.java

index a07e88b..9284f82 100644 (file)
@@ -130,11 +130,12 @@ public class ASequenceFetcher
     Hashtable<String, List<String>> queries = new Hashtable<>();
     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());