- product.addDBRef(pcdnaref);
- protEMBLCDS = new DBRefEntry(pcdnaref);
- protEMBLCDS.setSource(DBRefSource.EMBLCDSProduct);
- product.addDBRef(protEMBLCDS);
+ /*
+ * make xrefs from protein to EMBLCDS and EMBLCDSPROTEIN
+ */
+ DBRefEntry proteinToEmblCdsRef = new DBRefEntry();
+ proteinToEmblCdsRef.setAccessionId(proteinId);
+ proteinToEmblCdsRef.setSource(DBRefSource.EMBLCDS);
+ proteinToEmblCdsRef.setVersion(getSequenceVersion()); // same as
+ // parent EMBL
+ // version.
+ MapList mp = new MapList(new int[] { 1, translation.length() },
+ new int[] { 1 + (codonStart - 1),
+ (codonStart - 1) + 3 * translation.length() }, 1, 3);
+ proteinToEmblCdsRef.setMap(new Mapping(mp));
+ product.addDBRef(proteinToEmblCdsRef);
+ proteinToEmblProteinRef = new DBRefEntry(proteinToEmblCdsRef);
+ MapList mp2 = new MapList(
+ new int[] { 1, translation.length() }, new int[] { 1,
+ translation.length() }, 1, 1);
+ proteinToEmblProteinRef.setMap(new Mapping(mp2));
+ proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
+ product.addDBRef(proteinToEmblProteinRef);