if (product != null)
{
/*
- * make xrefs from protein to EMBLCDS and EMBLCDSPROTEIN
+ * make xref from protein to EMBLCDS; we assume here that the
+ * CDS sequence version is same as dna sequence (?!)
*/
- 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));
+ MapList proteinToCdsMapList = new MapList(new int[] { 1,
+ translation.length() }, new int[] { 1 + (codonStart - 1),
+ (codonStart - 1) + 3 * translation.length() }, 1, 3);
+ DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
+ DBRefSource.EMBLCDS, getSequenceVersion(), proteinId,
+ new Mapping(proteinToCdsMapList));
product.addDBRef(proteinToEmblCdsRef);
+
+ /*
+ * make xref from protein to EMBLCDSPROTEIN
+ */
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);
}
dna.addDBRef(ref);
}
}
+
/*
* if we have a product (translation) but no explicit Uniprot dbref
- * (example: EMBL AAFI02000057 protein_id EAL65544.1
- * construct mappings to an assumed EMBLCDSPROTEIN accession
+ * (example: EMBL AAFI02000057 protein_id EAL65544.1)
+ * then construct mappings to an assumed EMBLCDSPROTEIN accession
*/
if (!hasUniprotDbref && product != null)
{
if (proteinToEmblProteinRef == null)
{
- proteinToEmblProteinRef = new DBRefEntry();
- proteinToEmblProteinRef.setAccessionId(proteinId);
- proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
- proteinToEmblProteinRef.setVersion(getSequenceVersion());
- proteinToEmblProteinRef.setMap(new Mapping(product,
- dnaToProteinMapping.getMap().getInverse()));
+ // assuming CDSPROTEIN sequence version = dna version (?!)
+ proteinToEmblProteinRef = new DBRefEntry(
+ DBRefSource.EMBLCDSProduct, getSequenceVersion(), proteinId);
}
product.addDBRef(proteinToEmblProteinRef);
&& dnaToProteinMapping.getTo() != null)
{
DBRefEntry dnaToEmblProteinRef = new DBRefEntry(
- proteinToEmblProteinRef);
+ DBRefSource.EMBLCDSProduct, getSequenceVersion(), proteinId);
dnaToEmblProteinRef.setMap(dnaToProteinMapping);
dna.addDBRef(dnaToEmblProteinRef);
}