From: Jim Procter Date: Fri, 30 Sep 2016 16:40:19 +0000 (+0100) Subject: JAL-2210 add uniprot+mapping between ENST and ENSP seqs X-Git-Tag: Release_2_10_0~20^2~23 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=96153c4037c295b5a23ebb3196a0df7465732d92;p=jalview.git JAL-2210 add uniprot+mapping between ENST and ENSP seqs --- diff --git a/src/jalview/ext/ensembl/EnsemblSeqProxy.java b/src/jalview/ext/ensembl/EnsemblSeqProxy.java index 1bcfe22..c749b94 100644 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@ -2,9 +2,11 @@ package jalview.ext.ensembl; import jalview.analysis.AlignmentUtils; import jalview.analysis.Dna; +import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; import jalview.datamodel.Mapping; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; @@ -282,6 +284,44 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient DBRefEntry dbr = new DBRefEntry(getDbSource(), getEnsemblDataVersion(), proteinSeq.getName(), map); querySeq.getDatasetSequence().addDBRef(dbr); + DBRefEntry[] uprots = DBRefUtils.selectRefs(ds.getDBRefs(), + new String[] { DBRefSource.UNIPROT }); + DBRefEntry[] upxrefs = DBRefUtils.selectRefs(querySeq.getDBRefs(), + new String[] { DBRefSource.UNIPROT }); + if (uprots != null) + { + for (DBRefEntry up : uprots) + { + // locate local uniprot ref and map + List upx = DBRefUtils.searchRefs(upxrefs, up.getAccessionId()); + DBRefEntry upxref; + if (upx.size() != 0) + { + upxref = upx.get(0); + + if (upx.size() > 1) + { + Cache.log + .warn("Implementation issue - multiple uniprot acc on product sequence."); + } + } + else + { + upxref = new DBRefEntry(DBRefSource.UNIPROT, + getEnsemblDataVersion(), up.getAccessionId()); + } + + Mapping newMap = new Mapping(ds, mapList); + upxref.setVersion(getEnsemblDataVersion()); + upxref.setMap(newMap); + if (upx.size() == 0) + { + // add the new uniprot ref + querySeq.getDatasetSequence().addDBRef(upxref); + } + + } + } /* * copy exon features to protein, compute peptide variants from dna