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