+ try
+ {
+ Thread.sleep(10);
+ } catch (InterruptedException i)
+ {
+ }
+ }
+
+ /*
+ * get the distinct structure files modelled
+ * (a file with multiple chains may map to multiple sequences)
+ */
+ String[] files = getStructureFiles();
+ if (!waitForFileLoad(files))
+ {
+ return null;
+ }
+
+ StringBuilder selectioncom = new StringBuilder(256);
+ // In principle - nSeconds specifies the speed of animation for each
+ // superposition - but is seems to behave weirdly, so we don't specify it.
+ String nSeconds = " ";
+ if (files.length > 10)
+ {
+ nSeconds = " 0.005 ";
+ }
+ else
+ {
+ nSeconds = " " + (2.0 / files.length) + " ";
+ // if (nSeconds).substring(0,5)+" ";
+ }
+
+ // see JAL-1345 - should really automatically turn off the animation for
+ // large numbers of structures, but Jmol doesn't seem to allow that.
+ // nSeconds = " ";
+ // union of all aligned positions are collected together.
+ for (int a = 0; a < _alignment.length; a++)
+ {
+ int refStructure = _refStructure[a];
+ AlignmentI alignment = _alignment[a];
+ HiddenColumns hiddenCols = _hiddenCols[a];
+ if (a > 0 && selectioncom.length() > 0 && !selectioncom
+ .substring(selectioncom.length() - 1).equals("|"))
+ {
+ selectioncom.append("|");
+ }
+ // process this alignment
+ if (refStructure >= files.length)
+ {
+ System.err.println(
+ "Invalid reference structure value " + refStructure);
+ refStructure = -1;
+ }
+
+ /*
+ * 'matched' bit j will be set for visible alignment columns j where
+ * all sequences have a residue with a mapping to the PDB structure
+ */
+ BitSet matched = new BitSet();
+ for (int m = 0; m < alignment.getWidth(); m++)
+ {
+ if (hiddenCols == null || hiddenCols.isVisible(m))
+ {
+ matched.set(m);
+ }
+ }