JAL-2154 canonical dbsources are lowercased before matching
authorJim Procter <jprocter@issues.jalview.org>
Mon, 29 Aug 2016 21:10:27 +0000 (22:10 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 29 Aug 2016 21:10:27 +0000 (22:10 +0100)
src/jalview/util/DBRefUtils.java

index 1965c20..52629ed 100755 (executable)
@@ -31,6 +31,7 @@ import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import com.stevesoft.pat.Regex;
 
@@ -64,6 +65,13 @@ public class DBRefUtils
     canonicalSourceNameLookup.put("ensembl-tr", DBRefSource.ENSEMBL);
     canonicalSourceNameLookup.put("ensembl-gn", DBRefSource.ENSEMBL);
 
+    // Make sure we have lowercase entries for all canonical string lookups
+    Set<String> keys = canonicalSourceNameLookup.keySet();
+    for (String k : keys)
+    {
+      canonicalSourceNameLookup.put(k.toLowerCase(),
+              canonicalSourceNameLookup.get(k));
+    }
 
     dasCoordinateSystemsLookup.put("pdbresnum", DBRefSource.PDB);
     dasCoordinateSystemsLookup.put("uniprot", DBRefSource.UNIPROT);