X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FDBRefUtils.java;h=81710dd992b2f1eea5758c88c3575e1165866d73;hb=0753f0b8ac8473d278dfc255c04b174943c2b345;hp=381ed70f2df44bac23cd6adaea1361a7ac6f271c;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 381ed70..81710dd 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -90,6 +90,10 @@ public class DBRefUtils jalview.datamodel.DBRefSource.PDB); DasCoordinateSystemsLookup.put("uniprot", jalview.datamodel.DBRefSource.UNIPROT); + DasCoordinateSystemsLookup.put("EMBL", + jalview.datamodel.DBRefSource.EMBL); + //DasCoordinateSystemsLookup.put("EMBL", + // jalview.datamodel.DBRefSource.EMBLCDS); } String coordsys = (String) DasCoordinateSystemsLookup.get(string. @@ -100,4 +104,27 @@ public class DBRefUtils } return false; } + public static Hashtable CanonicalSourceNameLookup=null; + /** + * look up source in an internal list of database reference sources + * and return the canonical jalview name for the source, or the original + * string if it has no canonical form. + * @param source + * @return canonical jalview source (one of jalview.datamodel.DBRefSource.*) or original source + */ + public static String getCanonicalName(String source) + { + if (CanonicalSourceNameLookup==null) { + CanonicalSourceNameLookup = new Hashtable(); + CanonicalSourceNameLookup.put("uniprotkb/swiss-prot", jalview.datamodel.DBRefSource.UNIPROT); + CanonicalSourceNameLookup.put("pdb", jalview.datamodel.DBRefSource.PDB); + } + String canonical = (String) CanonicalSourceNameLookup.get(source. + toLowerCase()); + if (canonical==null) + { + return source; + } + return canonical; + } }