1 Clazz.declarePackage ("jalview.structure");
\r
2 Clazz.load (null, "jalview.structure.StructureMapping", ["jalview.datamodel.AlignmentAnnotation"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.mappingDetails = null;
\r
5 this.sequence = null;
\r
8 this.pdbchain = null;
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, jalview.structure, "StructureMapping");
\r
12 Clazz.makeConstructor (c$,
\r
13 function (seq, pdbfile, pdbid, chain, mapping, mappingDetails) {
\r
14 this.sequence = seq;
\r
15 this.pdbfile = pdbfile;
\r
17 this.pdbchain = chain;
\r
18 this.mapping = mapping;
\r
19 this.mappingDetails = mappingDetails;
\r
20 }, "jalview.datamodel.SequenceI,~S,~S,~S,~A,~S");
\r
21 Clazz.defineMethod (c$, "getSequence",
\r
23 return this.sequence;
\r
25 Clazz.defineMethod (c$, "getChain",
\r
27 return this.pdbchain;
\r
29 Clazz.defineMethod (c$, "getPdbId",
\r
33 Clazz.defineMethod (c$, "getAtomNum",
\r
35 if (this.mapping.length > seqpos) {
\r
36 return this.mapping[seqpos][1];
\r
40 Clazz.defineMethod (c$, "getPDBResNum",
\r
42 if (this.mapping.length > seqpos) {
\r
43 return this.mapping[seqpos][0];
\r
47 Clazz.defineMethod (c$, "getSeqPos",
\r
48 function (pdbResNum) {
\r
49 for (var i = 0; i < this.mapping.length; i++) {
\r
50 if (this.mapping[i][0] == pdbResNum) {
\r
55 Clazz.defineMethod (c$, "transfer",
\r
57 var ala_copy = new jalview.datamodel.AlignmentAnnotation (ana);
\r
58 var ds = this.sequence;
\r
59 while (ds.getDatasetSequence () != null) {
\r
60 ds = ds.getDatasetSequence ();
\r
62 ala_copy.remap (ds, this.mapping, -1, -1, 0);
\r
63 ds.addAlignmentAnnotation (ala_copy);
\r
64 if (ds !== this.sequence) {
\r
65 ala_copy = new jalview.datamodel.AlignmentAnnotation (ala_copy);
\r
66 this.sequence.addAlignmentAnnotation (ala_copy);
\r
68 }, "jalview.datamodel.AlignmentAnnotation");
\r