- 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));
+ DBRefEntry proteinToEmblRef = new DBRefEntry(DBRefSource.EMBL,
+ getSequenceVersion(), proteinId, new Mapping(
+ dnaToProteinMapping.getMap().getInverse()));
+ product.addDBRef(proteinToEmblRef);
+
+ /*
+ * make xref from protein to EMBLCDS; we assume here that the
+ * CDS sequence version is same as dna sequence (?!)
+ */
+ MapList proteinToCdsMapList = new MapList(new int[] { 1,
+ translationLength }, new int[] { 1 + (codonStart - 1),
+ (codonStart - 1) + 3 * translationLength }, 1, 3);
+ DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
+ DBRefSource.EMBLCDS, getSequenceVersion(), proteinId,
+ new Mapping(proteinToCdsMapList));