- // TODO should from range include stop codon even if not in protein
- // in order to include stop codon in CDS sequence (as done for
- // Ensembl)?
- int[] cdsRanges = adjustForProteinLength(prseq.length(), exon);
- map = new Mapping(product, cdsRanges, new int[] { 1,
- prseq.length() }, 3, 1);
- // reconstruct the EMBLCDS entry
- // TODO: this is only necessary when there codon annotation is
- // complete (I think JBPNote)
- DBRefEntry pcdnaref = new DBRefEntry();
- pcdnaref.setAccessionId(prid);
- pcdnaref.setSource(DBRefSource.EMBLCDS);
- pcdnaref.setVersion(getSequenceVersion()); // same as parent EMBL
- // version.
- MapList mp = new MapList(new int[] { 1, prseq.length() },
- new int[] { 1 + (codonStart - 1),
- (codonStart - 1) + 3 * prseq.length() }, 1, 3);
- pcdnaref.setMap(new Mapping(mp));
+ int[] cdsRanges = adjustForProteinLength(translation.length(), exons);
+ dnaToProteinMapping = new Mapping(product, cdsRanges, new int[] { 1,
+ translation.length() }, 3, 1);