+ 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 + ":" + uniprotRecordVersion;
+ dbr = new DBRefEntry(DBRefSource.EMBLCDS, version, vrs[0]);
+ // TODO: process VARIANT features to allow EMBLCDS record's product to
+ // match Uniprot
+ dbr.setCanonical(true);
+ dbRefs.add(dbr);
+ }
+ }
+ if (type != null
+ && type.toLowerCase(Locale.ROOT).startsWith("ensembl"))
+ {
+ // remove version
+ String[] vrs = dbref.getId().split("\\.");
+ String version = vrs.length > 1 ? vrs[1]
+ : DBRefSource.UNIPROT + ":" + uniprotRecordVersion;
+ dbr.setAccessionId(vrs[0]);
+ dbr.setVersion(version);
+ /*
+ * 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)
+ {
+ // remove version
+ String[] cdsVrs = cdsId.split("\\.");
+ String cdsVersion = cdsVrs.length > 1 ? cdsVrs[1]
+ : DBRefSource.UNIPROT + ":" + uniprotRecordVersion;
+ dbr = new DBRefEntry(DBRefSource.ENSEMBL,
+ DBRefSource.UNIPROT + ":" + cdsVersion, cdsVrs[0]);
+ dbRefs.add(dbr);
+ }
+ }