X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2Fxdb%2Fembl%2FEmblEntry.java;h=67d70595c9cb50ab9d52df716a94705248567057;hp=a2354edb653b80f81a14b1746d02f872a0e39ad5;hb=10083e0731425dedd9c2e4f3677dbdee2db8bc33;hpb=c10b07b9bc13113549333bf905aa0e6769cdc97a diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index a2354ed..67d7059 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -388,24 +388,21 @@ public class EmblEntry 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); } @@ -502,21 +499,19 @@ public class EmblEntry 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); @@ -524,7 +519,7 @@ public class EmblEntry && dnaToProteinMapping.getTo() != null) { DBRefEntry dnaToEmblProteinRef = new DBRefEntry( - proteinToEmblProteinRef); + DBRefSource.EMBLCDSProduct, getSequenceVersion(), proteinId); dnaToEmblProteinRef.setMap(dnaToProteinMapping); dna.addDBRef(dnaToEmblProteinRef); }