+ /*
+ * add a DBRefEntry for each dbReference element in the XML;
+ * also add a PDBEntry if type="PDB";
+ * also add an EMBLCDS dbref if protein sequence id is given
+ * also add an Ensembl dbref " " " " " "
+ */
+ Vector<PDBEntry> pdbRefs = new Vector<>();
+ for (DbReferenceType dbref : entry.getDbReference())
+ {
+ String type = dbref.getType();
+ DBRefEntry dbr = new DBRefEntry(type,
+ DBRefSource.UNIPROT + ":" + dbVersion, dbref.getId());
+ dbRefs.add(dbr);
+ if ("PDB".equals(type))
+ {
+ pdbRefs.add(new PDBEntry(dbr));
+ }
+ if ("EMBL".equals(type))
+ {
+ /*
+ * e.g. Uniprot accession Q9BXM7 has
+ * <dbReference type="EMBL" id="M19359">
+ * <property type="protein sequence ID" value="AAA40981.1"/>
+ * <property type="molecule type" value="Genomic_DNA"/>
+ * </dbReference>
+ */
+ String cdsId = getProperty(dbref.getProperty(),
+ "protein sequence ID");
+ if (cdsId != null && cdsId.trim().length() > 0)
+ {
+ // remove version
+ String[] vrs = cdsId.split("\\.");
+ String version = vrs.length > 1 ? vrs[1]
+ : DBRefSource.UNIPROT + ":" + dbVersion;
+ dbr = new DBRefEntry(DBRefSource.EMBLCDS, version, vrs[0]);
+ dbRefs.add(dbr);
+ }
+ }
+ if ("Ensembl".equals(type))
+ {
+ /*
+ * e.g. Uniprot accession Q9BXM7 has
+ * <dbReference type="Ensembl" id="ENST00000321556">
+ * <molecule id="Q9BXM7-1"/>
+ * <property type="protein sequence ID" value="ENSP00000364204"/>
+ * <property type="gene ID" value="ENSG00000158828"/>
+ * </dbReference>
+ */
+ String cdsId = getProperty(dbref.getProperty(),
+ "protein sequence ID");
+ if (cdsId != null && cdsId.trim().length() > 0)
+ {
+ dbr = new DBRefEntry(DBRefSource.ENSEMBL,
+ DBRefSource.UNIPROT + ":" + dbVersion, cdsId.trim());
+ dbRefs.add(dbr);