From 9f20cd3f523c61db9fa6c44022d50baa692356f4 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 20 Sep 2018 16:39:03 +0100 Subject: [PATCH] JAL-2755 add ENSEMBLGENOMES as a target for canonicalised database sources --- src/jalview/util/DBRefUtils.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; } -- 1.7.10.2