X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FUniprot.java;h=b6f53cd1408a8a321d87c13cf8ab312236c34588;hb=37de9310bec3501cbc6381e0c3dcb282fcaad812;hp=e26ccda1bcd6baab43655172d810288295bc9c5a;hpb=56bc65e4a83ab45cb98a37b60f0d547bd6ae9a71;p=jalview.git diff --git a/src/jalview/ws/dbsources/Uniprot.java b/src/jalview/ws/dbsources/Uniprot.java index e26ccda..b6f53cd 100644 --- a/src/jalview/ws/dbsources/Uniprot.java +++ b/src/jalview/ws/dbsources/Uniprot.java @@ -193,7 +193,8 @@ public class Uniprot extends DbSourceProxyImpl * UniprotEntry * @return SequenceI instance created from the UniprotEntry instance */ - public SequenceI uniprotEntryToSequenceI(UniprotEntry entry){ + public SequenceI uniprotEntryToSequenceI(UniprotEntry entry) + { String id = getUniprotEntryId(entry); SequenceI sequence = new Sequence(id, entry.getUniprotSequence() .getContent()); @@ -225,8 +226,7 @@ public class Uniprot extends DbSourceProxyImpl if ("EMBL".equals(pdb.getType())) { // look for a CDS reference and add it, too. - String cdsId = (String) pdb.getProperty() - .get("protein sequence ID"); + String cdsId = (String) pdb.getProperty("protein sequence ID"); if (cdsId != null && cdsId.trim().length() > 0) { // remove version @@ -236,7 +236,7 @@ public class Uniprot extends DbSourceProxyImpl dbRefs.add(dbr); } } - if (false) // "Ensembl".equals(pdb.getType())) + if ("Ensembl".equals(pdb.getType())) { /*UniprotXML * @@ -245,12 +245,9 @@ public class Uniprot extends DbSourceProxyImpl * * */ - String cdsId = (String) pdb.getProperty() - .get("protein sequence ID"); + String cdsId = (String) pdb.getProperty("protein sequence ID"); if (cdsId != null && cdsId.trim().length() > 0) { - // Only add the product ID - dbRefs.remove(dbr); dbr = new DBRefEntry(DBRefSource.ENSEMBL, DBRefSource.UNIPROT + ":" + dbVersion, cdsId.trim()); dbRefs.add(dbr); @@ -269,12 +266,10 @@ public class Uniprot extends DbSourceProxyImpl sequence.addSequenceFeature(sf); } } - // we use setDBRefs to assign refs quickly. - sequence.setDBRefs(dbRefs.toArray(new DBRefEntry[0])); - // need to use ensurePrimaries to reify any refs that should become primary - // refs - DBRefUtils.ensurePrimaries(sequence); // promote any direct refs to primary - // source dbs + for (DBRefEntry dbr : dbRefs) + { + sequence.addDBRef(dbr); + } return sequence; }