Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / structures / models / AAStructureBindingModel.js
index 63a34d4..e454a08 100644 (file)
-Clazz.declarePackage ("jalview.structures.models");\r
-Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.structure.StructureListener", "jalview.structures.models.SequenceStructureBindingModel"], "jalview.structures.models.AAStructureBindingModel", ["jalview.util.Comparison", "$.MessageManager", "java.lang.Error", "$.StringBuilder", "java.util.ArrayList", "$.Arrays"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.ssm = null;\r
-this.pdbEntry = null;\r
-this.sequence = null;\r
-this.chains = null;\r
-this.protocol = null;\r
-this.colourBySequence = true;\r
-this.nucleotide = false;\r
-if (!Clazz.isClassDefined ("jalview.structures.models.AAStructureBindingModel.SuperposeData")) {\r
-jalview.structures.models.AAStructureBindingModel.$AAStructureBindingModel$SuperposeData$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.structures.models, "AAStructureBindingModel", jalview.structures.models.SequenceStructureBindingModel, [jalview.structure.StructureListener, jalview.api.StructureSelectionManagerProvider]);\r
-Clazz.makeConstructor (c$, \r
-function (ssm, seqs) {\r
-Clazz.superConstructor (this, jalview.structures.models.AAStructureBindingModel, []);\r
-this.ssm = ssm;\r
-this.sequence = seqs;\r
-}, "jalview.structure.StructureSelectionManager,~A");\r
-Clazz.makeConstructor (c$, \r
-function (ssm, pdbentry, sequenceIs, chains, protocol) {\r
-Clazz.superConstructor (this, jalview.structures.models.AAStructureBindingModel, []);\r
-this.ssm = ssm;\r
-this.sequence = sequenceIs;\r
-this.nucleotide = jalview.util.Comparison.isNucleotide2 (sequenceIs);\r
-this.chains = chains;\r
-this.pdbEntry = pdbentry;\r
-this.protocol = protocol;\r
-if (chains == null) {\r
-this.chains =  new Array (pdbentry.length);\r
-}}, "jalview.structure.StructureSelectionManager,~A,~A,~A,~S");\r
-Clazz.defineMethod (c$, "getSsm", \r
-function () {\r
-return this.ssm;\r
-});\r
-Clazz.defineMethod (c$, "getPdbEntry", \r
-function (i) {\r
-return (this.pdbEntry != null && this.pdbEntry.length > i) ? this.pdbEntry[i] : null;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "hasPdbId", \r
-function (pdbId) {\r
-if (this.pdbEntry != null) {\r
-for (var pdb, $pdb = 0, $$pdb = this.pdbEntry; $pdb < $$pdb.length && ((pdb = $$pdb[$pdb]) || true); $pdb++) {\r
-if (pdb.getId ().equals (pdbId)) {\r
-return true;\r
-}}\r
-}return false;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getPdbCount", \r
-function () {\r
-return this.pdbEntry == null ? 0 : this.pdbEntry.length;\r
-});\r
-Clazz.defineMethod (c$, "getSequence", \r
-function () {\r
-return this.sequence;\r
-});\r
-Clazz.defineMethod (c$, "getChains", \r
-function () {\r
-return this.chains;\r
-});\r
-Clazz.defineMethod (c$, "getProtocol", \r
-function () {\r
-return this.protocol;\r
-});\r
-Clazz.defineMethod (c$, "setPdbentry", \r
-function (pdbentry) {\r
-this.pdbEntry = pdbentry;\r
-}, "~A");\r
-Clazz.defineMethod (c$, "setSequence", \r
-function (sequence) {\r
-this.sequence = sequence;\r
-}, "~A");\r
-Clazz.defineMethod (c$, "setChains", \r
-function (chains) {\r
-this.chains = chains;\r
-}, "~A");\r
-Clazz.defineMethod (c$, "getViewerTitle", \r
-function (viewerName, verbose) {\r
-if (this.getSequence () == null || this.getSequence ().length < 1 || this.getPdbCount () < 1 || this.getSequence ()[0].length < 1) {\r
-return ("Jalview " + viewerName + " Window");\r
-}var title =  new StringBuilder (64);\r
-var pdbEntry = this.getPdbEntry (0);\r
-title.append (viewerName + " view for " + this.getSequence ()[0][0].getName () + ":" + pdbEntry.getId ());\r
-if (verbose) {\r
-if (pdbEntry.getProperty () != null) {\r
-if (pdbEntry.getProperty ().get ("method") != null) {\r
-title.append (" Method: ");\r
-title.append (pdbEntry.getProperty ().get ("method"));\r
-}if (pdbEntry.getProperty ().get ("chains") != null) {\r
-title.append (" Chain:");\r
-title.append (pdbEntry.getProperty ().get ("chains"));\r
-}}}return title.toString ();\r
-}, "~S,~B");\r
-Clazz.defineMethod (c$, "releaseUIResources", \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "isColourBySequence", \r
-function () {\r
-return this.colourBySequence;\r
-});\r
-Clazz.defineMethod (c$, "setColourBySequence", \r
-function (colourBySequence) {\r
-this.colourBySequence = colourBySequence;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "addSequenceAndChain", \r
-function (pe, seq, tchain) {\r
-if (pe < 0 || pe >= this.getPdbCount ()) {\r
-throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_no_pdbentry_from_index",  Clazz.newArray (-1, [Integer.$valueOf (pe).toString ()])));\r
-}var nullChain = "TheNullChain";\r
-var s =  new java.util.ArrayList ();\r
-var c =  new java.util.ArrayList ();\r
-if (this.getChains () == null) {\r
-this.setChains ( new Array (this.getPdbCount ()));\r
-}if (this.getSequence ()[pe] != null) {\r
-for (var i = 0; i < this.getSequence ()[pe].length; i++) {\r
-s.add (this.getSequence ()[pe][i]);\r
-if (this.getChains ()[pe] != null) {\r
-if (i < this.getChains ()[pe].length) {\r
-c.add (this.getChains ()[pe][i]);\r
-} else {\r
-c.add ("TheNullChain");\r
-}} else {\r
-if (tchain != null && tchain.length > 0) {\r
-c.add ("TheNullChain");\r
-}}}\r
-}for (var i = 0; i < seq.length; i++) {\r
-if (!s.contains (seq[i])) {\r
-s.add (seq[i]);\r
-if (tchain != null && i < tchain.length) {\r
-c.add (tchain[i] == null ? "TheNullChain" : tchain[i]);\r
-}}}\r
-var tmp = s.toArray ( new Array (s.size ()));\r
-this.getSequence ()[pe] = tmp;\r
-if (c.size () > 0) {\r
-var tch = c.toArray ( new Array (c.size ()));\r
-for (var i = 0; i < tch.length; i++) {\r
-if (tch[i] === "TheNullChain") {\r
-tch[i] = null;\r
-}}\r
-this.getChains ()[pe] = tch;\r
-} else {\r
-this.getChains ()[pe] = null;\r
-}}, "~N,~A,~A");\r
-Clazz.defineMethod (c$, "addSequenceAndChain", \r
-function (pdbe, seq, chns) {\r
-var v =  new java.util.ArrayList ();\r
-var rtn =  new java.util.ArrayList ();\r
-for (var i = 0; i < this.getPdbCount (); i++) {\r
-v.add (this.getPdbEntry (i));\r
-}\r
-for (var i = 0; i < pdbe.length; i++) {\r
-var r = v.indexOf (pdbe[i]);\r
-if (r == -1 || r >= this.getPdbCount ()) {\r
-rtn.add ( Clazz.newIntArray (-1, [v.size (), i]));\r
-v.add (pdbe[i]);\r
-} else {\r
-this.addSequenceAndChain (r, seq[i], chns[i]);\r
-}}\r
-pdbe = v.toArray ( new Array (v.size ()));\r
-this.setPdbentry (pdbe);\r
-if (rtn.size () > 0) {\r
-var sqs =  new Array (this.getPdbCount ());\r
-var sch =  new Array (this.getPdbCount ());\r
-System.arraycopy (this.getSequence (), 0, sqs, 0, this.getSequence ().length);\r
-System.arraycopy (this.getChains (), 0, sch, 0, this.getChains ().length);\r
-this.setSequence (sqs);\r
-this.setChains (sch);\r
-pdbe =  new Array (rtn.size ());\r
-for (var r = 0; r < pdbe.length; r++) {\r
-var stri = (rtn.get (r));\r
-pdbe[r] = this.getPdbEntry (stri[0]);\r
-this.addSequenceAndChain (stri[0], seq[stri[1]], chns[stri[1]]);\r
-}\r
-} else {\r
-pdbe = null;\r
-}return pdbe;\r
-}, "~A,~A,~A");\r
-Clazz.defineMethod (c$, "addSequence", \r
-function (pe, seq) {\r
-this.addSequenceAndChain (pe, seq, null);\r
-}, "~N,~A");\r
-Clazz.defineMethod (c$, "addSequenceForStructFile", \r
-function (pdbFile, seq) {\r
-for (var pe = 0; pe < this.getPdbCount (); pe++) {\r
-if (this.getPdbEntry (pe).getFile ().equals (pdbFile)) {\r
-this.addSequence (pe, seq);\r
-}}\r
-}, "~S,~A");\r
-Clazz.defineMethod (c$, "isNucleotide", \r
-function () {\r
-return this.nucleotide;\r
-});\r
-Clazz.defineMethod (c$, "printMappings", \r
-function () {\r
-if (this.pdbEntry == null) {\r
-return "";\r
-}var sb =  new StringBuilder (128);\r
-for (var pdbe = 0; pdbe < this.getPdbCount (); pdbe++) {\r
-var pdbfile = this.getPdbEntry (pdbe).getFile ();\r
-var seqs = java.util.Arrays.asList (this.getSequence ()[pdbe]);\r
-sb.append (this.getSsm ().printMappings (pdbfile, seqs));\r
-}\r
-return sb.toString ();\r
-});\r
-Clazz.defineMethod (c$, "getMappedPosition", \r
-function (seq, alignedPos, mapping) {\r
-if (alignedPos >= seq.getLength ()) {\r
-return -1;\r
-}if (jalview.util.Comparison.isGap (seq.getCharAt (alignedPos))) {\r
-return -1;\r
-}var seqPos = seq.findPosition (alignedPos);\r
-var pos = mapping.getPDBResNum (seqPos);\r
-return pos;\r
-}, "jalview.datamodel.SequenceI,~N,jalview.structure.StructureMapping");\r
-Clazz.defineMethod (c$, "findSuperposableResidues", \r
-function (alignment, matched, structures) {\r
-var refStructure = -1;\r
-var files = this.getPdbFile ();\r
-for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {\r
-var mappings = this.getSsm ().getMapping (files[pdbfnum]);\r
-var lastPos = -1;\r
-var seqCountForPdbFile = this.getSequence ()[pdbfnum].length;\r
-for (var s = 0; s < seqCountForPdbFile; s++) {\r
-for (var mapping, $mapping = 0, $$mapping = mappings; $mapping < $$mapping.length && ((mapping = $$mapping[$mapping]) || true); $mapping++) {\r
-var theSequence = this.getSequence ()[pdbfnum][s];\r
-if (mapping.getSequence () === theSequence && alignment.findIndex (theSequence) > -1) {\r
-if (refStructure < 0) {\r
-refStructure = pdbfnum;\r
-}for (var r = 0; r < matched.length; r++) {\r
-if (!matched[r]) {\r
-continue;\r
-}var pos = this.getMappedPosition (theSequence, r, mapping);\r
-if (pos < 1 || pos == lastPos) {\r
-matched[r] = false;\r
-continue;\r
-}lastPos = pos;\r
-structures[pdbfnum].pdbResNo[r] = pos;\r
-}\r
-var chain = mapping.getChain ();\r
-if (chain != null && chain.trim ().length > 0) {\r
-structures[pdbfnum].chain = chain;\r
-}structures[pdbfnum].pdbId = mapping.getPdbId ();\r
-structures[pdbfnum].isRna = theSequence.getRNA () != null;\r
-s = seqCountForPdbFile;\r
-break;\r
-}}\r
-}\r
-}\r
-return refStructure;\r
-}, "jalview.datamodel.AlignmentI,~A,~A");\r
-Clazz.defineMethod (c$, "waitForFileLoad", \r
-function (files) {\r
-var starttime = System.currentTimeMillis ();\r
-var endTime = 10000 + 1000 * files.length + starttime;\r
-var notLoaded = null;\r
-var waiting = true;\r
-while (waiting && System.currentTimeMillis () < endTime) {\r
-waiting = false;\r
-for (var file, $file = 0, $$file = files; $file < $$file.length && ((file = $$file[$file]) || true); $file++) {\r
-notLoaded = file;\r
-try {\r
-var sm = this.getSsm ().getMapping (file);\r
-if (sm == null || sm.length == 0) {\r
-waiting = true;\r
-}} catch (x) {\r
-waiting = true;\r
-}\r
-}\r
-}\r
-if (waiting) {\r
-System.err.println ("Timed out waiting for structure viewer to load file " + notLoaded);\r
-return false;\r
-}return true;\r
-}, "~A");\r
-Clazz.overrideMethod (c$, "isListeningFor", \r
-function (seq) {\r
-if (this.sequence != null) {\r
-for (var seqs, $seqs = 0, $$seqs = this.sequence; $seqs < $$seqs.length && ((seqs = $$seqs[$seqs]) || true); $seqs++) {\r
-if (seqs != null) {\r
-for (var s, $s = 0, $$s = seqs; $s < $$s.length && ((s = $$s[$s]) || true); $s++) {\r
-if (s === seq) {\r
-return true;\r
-}}\r
-}}\r
-}return false;\r
-}, "jalview.datamodel.SequenceI");\r
-c$.$AAStructureBindingModel$SuperposeData$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.filename = null;\r
-this.pdbId = null;\r
-this.chain = "";\r
-this.isRna = false;\r
-this.pdbResNo = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.structures.models.AAStructureBindingModel, "SuperposeData");\r
-Clazz.makeConstructor (c$, \r
-function (a) {\r
-this.pdbResNo =  Clazz.newIntArray (a, 0);\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-});\r
+Clazz.declarePackage ("jalview.structures.models");
+Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.structure.StructureListener", "jalview.structures.models.SequenceStructureBindingModel"], "jalview.structures.models.AAStructureBindingModel", ["jalview.util.Comparison", "$.MessageManager", "java.lang.Error", "$.StringBuilder", "java.util.ArrayList", "$.Arrays"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.ssm = null;
+this.pdbEntry = null;
+this.sequence = null;
+this.chains = null;
+this.protocol = null;
+this.colourBySequence = true;
+this.nucleotide = false;
+if (!Clazz.isClassDefined ("jalview.structures.models.AAStructureBindingModel.SuperposeData")) {
+jalview.structures.models.AAStructureBindingModel.$AAStructureBindingModel$SuperposeData$ ();
+}
+Clazz.instantialize (this, arguments);
+}, jalview.structures.models, "AAStructureBindingModel", jalview.structures.models.SequenceStructureBindingModel, [jalview.structure.StructureListener, jalview.api.StructureSelectionManagerProvider]);
+Clazz.makeConstructor (c$, 
+function (ssm, seqs) {
+Clazz.superConstructor (this, jalview.structures.models.AAStructureBindingModel, []);
+this.ssm = ssm;
+this.sequence = seqs;
+}, "jalview.structure.StructureSelectionManager,~A");
+Clazz.makeConstructor (c$, 
+function (ssm, pdbentry, sequenceIs, chains, protocol) {
+Clazz.superConstructor (this, jalview.structures.models.AAStructureBindingModel, []);
+this.ssm = ssm;
+this.sequence = sequenceIs;
+this.nucleotide = jalview.util.Comparison.isNucleotide2 (sequenceIs);
+this.chains = chains;
+this.pdbEntry = pdbentry;
+this.protocol = protocol;
+if (chains == null) {
+this.chains =  new Array (pdbentry.length);
+}}, "jalview.structure.StructureSelectionManager,~A,~A,~A,~S");
+Clazz.defineMethod (c$, "getSsm", 
+function () {
+return this.ssm;
+});
+Clazz.defineMethod (c$, "getPdbEntry", 
+function (i) {
+return (this.pdbEntry != null && this.pdbEntry.length > i) ? this.pdbEntry[i] : null;
+}, "~N");
+Clazz.defineMethod (c$, "hasPdbId", 
+function (pdbId) {
+if (this.pdbEntry != null) {
+for (var pdb, $pdb = 0, $$pdb = this.pdbEntry; $pdb < $$pdb.length && ((pdb = $$pdb[$pdb]) || true); $pdb++) {
+if (pdb.getId ().equals (pdbId)) {
+return true;
+}}
+}return false;
+}, "~S");
+Clazz.defineMethod (c$, "getPdbCount", 
+function () {
+return this.pdbEntry == null ? 0 : this.pdbEntry.length;
+});
+Clazz.defineMethod (c$, "getSequence", 
+function () {
+return this.sequence;
+});
+Clazz.defineMethod (c$, "getChains", 
+function () {
+return this.chains;
+});
+Clazz.defineMethod (c$, "getProtocol", 
+function () {
+return this.protocol;
+});
+Clazz.defineMethod (c$, "setPdbentry", 
+function (pdbentry) {
+this.pdbEntry = pdbentry;
+}, "~A");
+Clazz.defineMethod (c$, "setSequence", 
+function (sequence) {
+this.sequence = sequence;
+}, "~A");
+Clazz.defineMethod (c$, "setChains", 
+function (chains) {
+this.chains = chains;
+}, "~A");
+Clazz.defineMethod (c$, "getViewerTitle", 
+function (viewerName, verbose) {
+if (this.getSequence () == null || this.getSequence ().length < 1 || this.getPdbCount () < 1 || this.getSequence ()[0].length < 1) {
+return ("Jalview " + viewerName + " Window");
+}var title =  new StringBuilder (64);
+var pdbEntry = this.getPdbEntry (0);
+title.append (viewerName + " view for " + this.getSequence ()[0][0].getName () + ":" + pdbEntry.getId ());
+if (verbose) {
+if (pdbEntry.getProperty () != null) {
+if (pdbEntry.getProperty ().get ("method") != null) {
+title.append (" Method: ");
+title.append (pdbEntry.getProperty ().get ("method"));
+}if (pdbEntry.getProperty ().get ("chains") != null) {
+title.append (" Chain:");
+title.append (pdbEntry.getProperty ().get ("chains"));
+}}}return title.toString ();
+}, "~S,~B");
+Clazz.defineMethod (c$, "releaseUIResources", 
+function () {
+});
+Clazz.defineMethod (c$, "isColourBySequence", 
+function () {
+return this.colourBySequence;
+});
+Clazz.defineMethod (c$, "setColourBySequence", 
+function (colourBySequence) {
+this.colourBySequence = colourBySequence;
+}, "~B");
+Clazz.defineMethod (c$, "addSequenceAndChain", 
+function (pe, seq, tchain) {
+if (pe < 0 || pe >= this.getPdbCount ()) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_no_pdbentry_from_index",  Clazz.newArray (-1, [Integer.$valueOf (pe).toString ()])));
+}var nullChain = "TheNullChain";
+var s =  new java.util.ArrayList ();
+var c =  new java.util.ArrayList ();
+if (this.getChains () == null) {
+this.setChains ( new Array (this.getPdbCount ()));
+}if (this.getSequence ()[pe] != null) {
+for (var i = 0; i < this.getSequence ()[pe].length; i++) {
+s.add (this.getSequence ()[pe][i]);
+if (this.getChains ()[pe] != null) {
+if (i < this.getChains ()[pe].length) {
+c.add (this.getChains ()[pe][i]);
+} else {
+c.add ("TheNullChain");
+}} else {
+if (tchain != null && tchain.length > 0) {
+c.add ("TheNullChain");
+}}}
+}for (var i = 0; i < seq.length; i++) {
+if (!s.contains (seq[i])) {
+s.add (seq[i]);
+if (tchain != null && i < tchain.length) {
+c.add (tchain[i] == null ? "TheNullChain" : tchain[i]);
+}}}
+var tmp = s.toArray ( new Array (s.size ()));
+this.getSequence ()[pe] = tmp;
+if (c.size () > 0) {
+var tch = c.toArray ( new Array (c.size ()));
+for (var i = 0; i < tch.length; i++) {
+if (tch[i] === "TheNullChain") {
+tch[i] = null;
+}}
+this.getChains ()[pe] = tch;
+} else {
+this.getChains ()[pe] = null;
+}}, "~N,~A,~A");
+Clazz.defineMethod (c$, "addSequenceAndChain", 
+function (pdbe, seq, chns) {
+var v =  new java.util.ArrayList ();
+var rtn =  new java.util.ArrayList ();
+for (var i = 0; i < this.getPdbCount (); i++) {
+v.add (this.getPdbEntry (i));
+}
+for (var i = 0; i < pdbe.length; i++) {
+var r = v.indexOf (pdbe[i]);
+if (r == -1 || r >= this.getPdbCount ()) {
+rtn.add ( Clazz.newIntArray (-1, [v.size (), i]));
+v.add (pdbe[i]);
+} else {
+this.addSequenceAndChain (r, seq[i], chns[i]);
+}}
+pdbe = v.toArray ( new Array (v.size ()));
+this.setPdbentry (pdbe);
+if (rtn.size () > 0) {
+var sqs =  new Array (this.getPdbCount ());
+var sch =  new Array (this.getPdbCount ());
+System.arraycopy (this.getSequence (), 0, sqs, 0, this.getSequence ().length);
+System.arraycopy (this.getChains (), 0, sch, 0, this.getChains ().length);
+this.setSequence (sqs);
+this.setChains (sch);
+pdbe =  new Array (rtn.size ());
+for (var r = 0; r < pdbe.length; r++) {
+var stri = (rtn.get (r));
+pdbe[r] = this.getPdbEntry (stri[0]);
+this.addSequenceAndChain (stri[0], seq[stri[1]], chns[stri[1]]);
+}
+} else {
+pdbe = null;
+}return pdbe;
+}, "~A,~A,~A");
+Clazz.defineMethod (c$, "addSequence", 
+function (pe, seq) {
+this.addSequenceAndChain (pe, seq, null);
+}, "~N,~A");
+Clazz.defineMethod (c$, "addSequenceForStructFile", 
+function (pdbFile, seq) {
+for (var pe = 0; pe < this.getPdbCount (); pe++) {
+if (this.getPdbEntry (pe).getFile ().equals (pdbFile)) {
+this.addSequence (pe, seq);
+}}
+}, "~S,~A");
+Clazz.defineMethod (c$, "isNucleotide", 
+function () {
+return this.nucleotide;
+});
+Clazz.defineMethod (c$, "printMappings", 
+function () {
+if (this.pdbEntry == null) {
+return "";
+}var sb =  new StringBuilder (128);
+for (var pdbe = 0; pdbe < this.getPdbCount (); pdbe++) {
+var pdbfile = this.getPdbEntry (pdbe).getFile ();
+var seqs = java.util.Arrays.asList (this.getSequence ()[pdbe]);
+sb.append (this.getSsm ().printMappings (pdbfile, seqs));
+}
+return sb.toString ();
+});
+Clazz.defineMethod (c$, "getMappedPosition", 
+function (seq, alignedPos, mapping) {
+if (alignedPos >= seq.getLength ()) {
+return -1;
+}if (jalview.util.Comparison.isGap (seq.getCharAt (alignedPos))) {
+return -1;
+}var seqPos = seq.findPosition (alignedPos);
+var pos = mapping.getPDBResNum (seqPos);
+return pos;
+}, "jalview.datamodel.SequenceI,~N,jalview.structure.StructureMapping");
+Clazz.defineMethod (c$, "findSuperposableResidues", 
+function (alignment, matched, structures) {
+var refStructure = -1;
+var files = this.getPdbFile ();
+for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {
+var mappings = this.getSsm ().getMapping (files[pdbfnum]);
+var lastPos = -1;
+var seqCountForPdbFile = this.getSequence ()[pdbfnum].length;
+for (var s = 0; s < seqCountForPdbFile; s++) {
+for (var mapping, $mapping = 0, $$mapping = mappings; $mapping < $$mapping.length && ((mapping = $$mapping[$mapping]) || true); $mapping++) {
+var theSequence = this.getSequence ()[pdbfnum][s];
+if (mapping.getSequence () === theSequence && alignment.findIndex (theSequence) > -1) {
+if (refStructure < 0) {
+refStructure = pdbfnum;
+}for (var r = 0; r < matched.length; r++) {
+if (!matched[r]) {
+continue;
+}var pos = this.getMappedPosition (theSequence, r, mapping);
+if (pos < 1 || pos == lastPos) {
+matched[r] = false;
+continue;
+}lastPos = pos;
+structures[pdbfnum].pdbResNo[r] = pos;
+}
+var chain = mapping.getChain ();
+if (chain != null && chain.trim ().length > 0) {
+structures[pdbfnum].chain = chain;
+}structures[pdbfnum].pdbId = mapping.getPdbId ();
+structures[pdbfnum].isRna = theSequence.getRNA () != null;
+s = seqCountForPdbFile;
+break;
+}}
+}
+}
+return refStructure;
+}, "jalview.datamodel.AlignmentI,~A,~A");
+Clazz.defineMethod (c$, "waitForFileLoad", 
+function (files) {
+var starttime = System.currentTimeMillis ();
+var endTime = 10000 + 1000 * files.length + starttime;
+var notLoaded = null;
+var waiting = true;
+while (waiting && System.currentTimeMillis () < endTime) {
+waiting = false;
+for (var file, $file = 0, $$file = files; $file < $$file.length && ((file = $$file[$file]) || true); $file++) {
+notLoaded = file;
+try {
+var sm = this.getSsm ().getMapping (file);
+if (sm == null || sm.length == 0) {
+waiting = true;
+}} catch (x) {
+waiting = true;
+}
+}
+}
+if (waiting) {
+System.err.println ("Timed out waiting for structure viewer to load file " + notLoaded);
+return false;
+}return true;
+}, "~A");
+Clazz.overrideMethod (c$, "isListeningFor", 
+function (seq) {
+if (this.sequence != null) {
+for (var seqs, $seqs = 0, $$seqs = this.sequence; $seqs < $$seqs.length && ((seqs = $$seqs[$seqs]) || true); $seqs++) {
+if (seqs != null) {
+for (var s, $s = 0, $$s = seqs; $s < $$s.length && ((s = $$s[$s]) || true); $s++) {
+if (s === seq) {
+return true;
+}}
+}}
+}return false;
+}, "jalview.datamodel.SequenceI");
+c$.$AAStructureBindingModel$SuperposeData$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.filename = null;
+this.pdbId = null;
+this.chain = "";
+this.isRna = false;
+this.pdbResNo = null;
+Clazz.instantialize (this, arguments);
+}, jalview.structures.models.AAStructureBindingModel, "SuperposeData");
+Clazz.makeConstructor (c$, 
+function (a) {
+this.pdbResNo =  Clazz.newIntArray (a, 0);
+}, "~N");
+c$ = Clazz.p0p ();
+};
+});