From c8805abb1d906a556fb97808959670a71a9bb491 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Tue, 5 Dec 2017 12:39:23 +0000 Subject: [PATCH] JAL-2847 added pfam to DBRef source name lookup --- src/jalview/util/DBRefUtils.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 50a34fc..203b4e7 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -43,9 +43,9 @@ public class DBRefUtils /* * lookup from lower-case form of a name to its canonical (standardised) form */ - private static Map canonicalSourceNameLookup = new HashMap(); + private static Map canonicalSourceNameLookup = new HashMap<>(); - private static Map dasCoordinateSystemsLookup = new HashMap(); + private static Map dasCoordinateSystemsLookup = new HashMap<>(); static { @@ -65,6 +65,8 @@ public class DBRefUtils canonicalSourceNameLookup.put("ensembl-tr", DBRefSource.ENSEMBL); canonicalSourceNameLookup.put("ensembl-gn", DBRefSource.ENSEMBL); + canonicalSourceNameLookup.put("pfam", DBRefSource.PFAM); + // Make sure we have lowercase entries for all canonical string lookups Set keys = canonicalSourceNameLookup.keySet(); for (String k : keys) @@ -97,13 +99,13 @@ public class DBRefUtils { return dbrefs; } - HashSet srcs = new HashSet(); + HashSet srcs = new HashSet<>(); for (String src : sources) { srcs.add(src.toUpperCase()); } - List res = new ArrayList(); + List res = new ArrayList<>(); for (DBRefEntry dbr : dbrefs) { String source = getCanonicalName(dbr.getSource()); @@ -218,7 +220,7 @@ public class DBRefUtils static List searchRefs(DBRefEntry[] refs, DBRefEntry entry, DbRefComp comparator) { - List rfs = new ArrayList(); + List rfs = new ArrayList<>(); if (refs == null || entry == null) { return rfs; @@ -594,7 +596,7 @@ public class DBRefUtils public static List searchRefsForSource(DBRefEntry[] dbRefs, String source) { - List matches = new ArrayList(); + List matches = new ArrayList<>(); if (dbRefs != null && source != null) { for (DBRefEntry dbref : dbRefs) @@ -644,7 +646,7 @@ public class DBRefUtils // nothing to do return; } - List selfs = new ArrayList(); + List selfs = new ArrayList<>(); { DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(), sequence.getDBRefs()); @@ -664,11 +666,11 @@ public class DBRefUtils selfs.remove(p); } } - List toPromote = new ArrayList(); + List toPromote = new ArrayList<>(); for (DBRefEntry p : pr) { - List promType = new ArrayList(); + List promType = new ArrayList<>(); if (sequence.isProtein()) { switch (getCanonicalName(p.getSource())) -- 1.7.10.2