X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fstructure%2FStructureMapping.js;h=40c774f8db731143d0a2b80ea1f5c4fdd7e2fa1b;hp=8cf2f338d20400c9fa6fc48aca229515c84c2aa3;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6 diff --git a/site/j2s/jalview/structure/StructureMapping.js b/site/j2s/jalview/structure/StructureMapping.js index 8cf2f33..40c774f 100644 --- a/site/j2s/jalview/structure/StructureMapping.js +++ b/site/j2s/jalview/structure/StructureMapping.js @@ -1,69 +1,69 @@ -Clazz.declarePackage ("jalview.structure"); -Clazz.load (null, "jalview.structure.StructureMapping", ["jalview.datamodel.AlignmentAnnotation"], function () { -c$ = Clazz.decorateAsClass (function () { -this.mappingDetails = null; -this.sequence = null; -this.pdbfile = null; -this.pdbid = null; -this.pdbchain = null; -this.mapping = null; -Clazz.instantialize (this, arguments); -}, jalview.structure, "StructureMapping"); -Clazz.makeConstructor (c$, -function (seq, pdbfile, pdbid, chain, mapping, mappingDetails) { -this.sequence = seq; -this.pdbfile = pdbfile; -this.pdbid = pdbid; -this.pdbchain = chain; -this.mapping = mapping; -this.mappingDetails = mappingDetails; -}, "jalview.datamodel.SequenceI,~S,~S,~S,~A,~S"); -Clazz.defineMethod (c$, "getSequence", -function () { -return this.sequence; -}); -Clazz.defineMethod (c$, "getChain", -function () { -return this.pdbchain; -}); -Clazz.defineMethod (c$, "getPdbId", -function () { -return this.pdbid; -}); -Clazz.defineMethod (c$, "getAtomNum", -function (seqpos) { -if (this.mapping.length > seqpos) { -return this.mapping[seqpos][1]; -} else { -return 0; -}}, "~N"); -Clazz.defineMethod (c$, "getPDBResNum", -function (seqpos) { -if (this.mapping.length > seqpos) { -return this.mapping[seqpos][0]; -} else { -return 0; -}}, "~N"); -Clazz.defineMethod (c$, "getSeqPos", -function (pdbResNum) { -for (var i = 0; i < this.mapping.length; i++) { -if (this.mapping[i][0] == pdbResNum) { -return i; -}} -return -1; -}, "~N"); -Clazz.defineMethod (c$, "transfer", -function (ana) { -var ala_copy = new jalview.datamodel.AlignmentAnnotation (ana); -var ds = this.sequence; -while (ds.getDatasetSequence () != null) { -ds = ds.getDatasetSequence (); -} -ala_copy.remap (ds, this.mapping, -1, -1, 0); -ds.addAlignmentAnnotation (ala_copy); -if (ds !== this.sequence) { -ala_copy = new jalview.datamodel.AlignmentAnnotation (ala_copy); -this.sequence.addAlignmentAnnotation (ala_copy); -}return ala_copy; -}, "jalview.datamodel.AlignmentAnnotation"); -}); +Clazz.declarePackage ("jalview.structure"); +Clazz.load (null, "jalview.structure.StructureMapping", ["jalview.datamodel.AlignmentAnnotation"], function () { +c$ = Clazz.decorateAsClass (function () { +this.mappingDetails = null; +this.sequence = null; +this.pdbfile = null; +this.pdbid = null; +this.pdbchain = null; +this.mapping = null; +Clazz.instantialize (this, arguments); +}, jalview.structure, "StructureMapping"); +Clazz.makeConstructor (c$, +function (seq, pdbfile, pdbid, chain, mapping, mappingDetails) { +this.sequence = seq; +this.pdbfile = pdbfile; +this.pdbid = pdbid; +this.pdbchain = chain; +this.mapping = mapping; +this.mappingDetails = mappingDetails; +}, "jalview.datamodel.SequenceI,~S,~S,~S,~A,~S"); +Clazz.defineMethod (c$, "getSequence", +function () { +return this.sequence; +}); +Clazz.defineMethod (c$, "getChain", +function () { +return this.pdbchain; +}); +Clazz.defineMethod (c$, "getPdbId", +function () { +return this.pdbid; +}); +Clazz.defineMethod (c$, "getAtomNum", +function (seqpos) { +if (this.mapping.length > seqpos) { +return this.mapping[seqpos][1]; +} else { +return 0; +}}, "~N"); +Clazz.defineMethod (c$, "getPDBResNum", +function (seqpos) { +if (this.mapping.length > seqpos) { +return this.mapping[seqpos][0]; +} else { +return 0; +}}, "~N"); +Clazz.defineMethod (c$, "getSeqPos", +function (pdbResNum) { +for (var i = 0; i < this.mapping.length; i++) { +if (this.mapping[i][0] == pdbResNum) { +return i; +}} +return -1; +}, "~N"); +Clazz.defineMethod (c$, "transfer", +function (ana) { +var ala_copy = new jalview.datamodel.AlignmentAnnotation (ana); +var ds = this.sequence; +while (ds.getDatasetSequence () != null) { +ds = ds.getDatasetSequence (); +} +ala_copy.remap (ds, this.mapping, -1, -1, 0); +ds.addAlignmentAnnotation (ala_copy); +if (ds !== this.sequence) { +ala_copy = new jalview.datamodel.AlignmentAnnotation (ala_copy); +this.sequence.addAlignmentAnnotation (ala_copy); +}return ala_copy; +}, "jalview.datamodel.AlignmentAnnotation"); +});