From: Jim Procter Date: Thu, 20 Sep 2018 15:39:03 +0000 (+0100) Subject: JAL-2755 add ENSEMBLGENOMES as a target for canonicalised database sources X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9f20cd3f523c61db9fa6c44022d50baa692356f4;p=jalview.git JAL-2755 add ENSEMBLGENOMES as a target for canonicalised database sources --- diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 50a34fc..b9939e6 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -65,6 +65,9 @@ public class DBRefUtils canonicalSourceNameLookup.put("ensembl-tr", DBRefSource.ENSEMBL); canonicalSourceNameLookup.put("ensembl-gn", DBRefSource.ENSEMBL); + canonicalSourceNameLookup.put("ensemblgenomes", + DBRefSource.ENSEMBLGENOMES); + // Make sure we have lowercase entries for all canonical string lookups Set keys = canonicalSourceNameLookup.keySet(); for (String k : keys) @@ -160,6 +163,20 @@ public class DBRefUtils return null; } String canonical = canonicalSourceNameLookup.get(source.toLowerCase()); + if (canonical==null) + { + if (source.toLowerCase().startsWith("ensembl")) + { + canonical = DBRefSource.ENSEMBL; + for (String ensembls: new String[] { "Protists","Plants","Bacteria","Fungi","Metazoa"}) + { + if (source.toLowerCase().endsWith(ensembls.toLowerCase())) + { + canonical = DBRefSource.ENSEMBLGENOMES; + } + } + } + } return canonical == null ? source : canonical; }