From 663695f530e1cdef9cabdcd75d947219a1dd5c83 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 21 Jun 2016 09:57:36 +0100 Subject: [PATCH] JAL-2113 tidy up canonicalisation of Uniprot xrefs in EMBL data --- src/jalview/datamodel/xdb/embl/EmblEntry.java | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index b750973..ac0d339 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -197,7 +197,10 @@ public class EmblEntry // dbref retrievedref.setMap(new Mapping(null, new int[] { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1, 1)); - // TODO: transform EMBL Database refs to canonical form + + /* + * transform EMBL Database refs to canonical form + */ if (dbRefs != null) { for (DBRefEntry dbref : dbRefs) @@ -211,17 +214,6 @@ public class EmblEntry { for (EmblFeature feature : features) { - if (feature.dbRefs != null) - { - for (DBRefEntry dbref : feature.dbRefs) - { - /* - * convert UniProtKB/Swiss-Prot to UNIPROT - */ - dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource())); - dna.addDBRef(dbref); - } - } if (FeatureProperties.isCodingFeature(sourceDb, feature.getName())) { parseCodingFeature(feature, sourceDb, dna, peptides); @@ -426,13 +418,17 @@ public class EmblEntry } /* - * add mappings for Uniprot xrefs + * add dbRefs to sequence, and mappings for Uniprot xrefs */ if (feature.dbRefs != null) { boolean mappingUsed = false; for (DBRefEntry ref : feature.dbRefs) { + /* + * ensure UniProtKB/Swiss-Prot converted to UNIPROT + */ + ref.setSource(DBRefUtils.getCanonicalName(ref.getSource())); if (ref.getSource().equals(DBRefSource.UNIPROT)) { String proteinSeqName = DBRefSource.UNIPROT + "|" @@ -488,6 +484,7 @@ public class EmblEntry } } } + dna.addDBRef(ref); } if (noProteinDbref && product != null) { -- 1.7.10.2