chimmaps.put(file, newList);
for (ChimeraModel cm : newList)
{
- while (mdlToFile.size()<1+cm.getModelNumber())
+ while (mdlToFile.size() < 1 + cm.getModelNumber())
{
mdlToFile.add(new String(""));
}
.println("RUNTIME PROBLEM: Jmol seems to be taking a long time to process all the structures.");
return;
}
+ refreshPdbEntries();
StringBuffer selectioncom = new StringBuffer();
- // 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.00001 ";
- }
- 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];
if (a > 0
&& selectioncom.length() > 0
&& !selectioncom.substring(selectioncom.length() - 1).equals(
- "|"))
+ " "))
{
- selectioncom.append("|");
+ selectioncom.append(" ");
}
// process this alignment
if (refStructure >= files.length)
if (mapping == null || mapping.length < 1)
{
throw new Error(
- "Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
+ "Implementation error - Chimera seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
}
int lastPos = -1;
for (int s = 0; s < sequence[pdbfnum].length; s++)
commonrpositions[pdbfnum][r] = pos;
}
// create model selection suffix
- isel[pdbfnum] = "/" + (pdbfnum + 1) + ".1";
+ isel[pdbfnum] = "#" + pdbfnum;
if (mapping[m].getChain() == null
|| mapping[m].getChain().trim().length() == 0)
{
}
else
{
- targetC[pdbfnum] = ":" + mapping[m].getChain();
+ targetC[pdbfnum] = "." + mapping[m].getChain();
}
chainNames[pdbfnum] = mapping[m].getPdbId()
+ targetC[pdbfnum];
String[] selcom = new String[files.length];
int nmatched = 0;
+ String sep = "";
// generate select statements to select regions to superimpose structures
{
for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
int lpos = -1;
boolean run = false;
StringBuffer molsel = new StringBuffer();
- molsel.append("{");
for (int r = 0; r < matched.length; r++)
{
if (matched[r])
// discontinuity
if (lpos != -1)
{
- molsel.append(lpos);
+ molsel.append((run ? "" : ":") + lpos);
molsel.append(chainCd);
// molsel.append("} {");
- molsel.append("|");
+ // molsel.append(",");
}
}
else
if (!run)
{
// at the beginning, so add dash
- molsel.append(lpos);
+ molsel.append(":" + lpos);
molsel.append("-");
}
run = true;
// add final selection phrase
if (lpos != -1)
{
- molsel.append(lpos);
+ molsel.append((run ? "" : ":") + lpos);
molsel.append(chainCd);
- molsel.append("}");
+ // molsel.append("");
}
if (molsel.length() > 1)
{
selcom[pdbfnum] = molsel.toString();
- selectioncom.append("((");
+ selectioncom.append("#" + pdbfnum);
selectioncom.append(selcom[pdbfnum].substring(1,
selcom[pdbfnum].length() - 1));
- selectioncom.append(" )& ");
- selectioncom.append(pdbfnum + 1);
- selectioncom.append(".1)");
+ selectioncom.append(" ");
if (pdbfnum < files.length - 1)
{
selectioncom.append("|");
{
continue;
}
- command.append("echo ");
- command.append("\"Superposing (");
- command.append(chainNames[pdbfnum]);
- command.append(") against reference (");
- command.append(chainNames[refStructure]);
- command.append(")\";\ncompare " + nSeconds);
- command.append("{");
- command.append(1 + pdbfnum);
- command.append(".1} {");
- command.append(1 + refStructure);
- command.append(".1} SUBSET {*.CA | *.P} ATOMS ");
+ command.append("match ");
// form the matched pair strings
- String sep = "";
for (int s = 0; s < 2; s++)
{
command.append(selcom[(s == 0 ? pdbfnum : refStructure)]);
}
- command.append(" ROTATE TRANSLATE;\n");
}
if (selectioncom.length() > 0)
{
System.out.println("Select regions:\n" + selectioncom.toString());
- evalStateCommand("select *; cartoons off; backbone; select ("
- + selectioncom.toString() + "); cartoons; ");
+ evalStateCommand("~display *; trace *; ribbons "
+ + selectioncom.toString() + "");
// selcom.append("; ribbons; ");
System.out
.println("Superimpose command(s):\n" + command.toString());
selectioncom.setLength(selectioncom.length() - 1);
}
System.out.println("Select regions:\n" + selectioncom.toString());
- evalStateCommand("select *; cartoons off; backbone; select ("
- + selectioncom.toString() + "); cartoons; ");
+ evalStateCommand("~display *; trace *; ribbons "
+ + selectioncom.toString() + "");
// evalStateCommand("select *; backbone; select "+selcom.toString()+"; cartoons; center "+selcom.toString());
}
}
}
}
- public void evalStateCommand(String command)
+ public void evalStateCommand(final String command)
{
viewerCommandHistory(false);
checkLaunched();
if (lastCommand == null || !lastCommand.equals(command))
{
-
- lastReply = viewer.sendChimeraCommand(command, true);
- if (debug)
- {
- log("Response from command ('" + command + "') was:\n" + lastReply);
- }
+// Thread t = new Thread(new Runnable()
+// {
+// @Override
+// public void run()
+// {
+ lastReply = viewer.sendChimeraCommand(command, true);
+ if (debug)
+ {
+ log("Response from command ('" + command + "') was:\n"
+ + lastReply);
+ }
+// }
+// });
+ // TODO - use j7/8 thread management
+// try
+// {
+// t.join();
+// } catch (InterruptedException foo)
+// {
+// }
+// ;
}
viewerCommandHistory(true);
lastCommand = command;
{
return new String[0];
}
-// if (modelFileNames == null)
-// {
-// Collection<ChimeraModel> chimodels = viewer.getChimeraModels();
-// _modelFileNameMap = new int[chimodels.size()];
-// int j = 0;
-// for (ChimeraModel chimodel : chimodels)
-// {
-// String mdlName = chimodel.getModelName();
-// }
-// modelFileNames = new String[j];
-// // System.arraycopy(mset, 0, modelFileNames, 0, j);
-// }
+ // if (modelFileNames == null)
+ // {
+ // Collection<ChimeraModel> chimodels = viewer.getChimeraModels();
+ // _modelFileNameMap = new int[chimodels.size()];
+ // int j = 0;
+ // for (ChimeraModel chimodel : chimodels)
+ // {
+ // String mdlName = chimodel.getModelName();
+ // }
+ // modelFileNames = new String[j];
+ // // System.arraycopy(mset, 0, modelFileNames, 0, j);
+ // }
return chimmaps.keySet().toArray(
modelFileNames = new String[chimmaps.size()]);
viewer.stopListening();
if (resetLastRes.length() > 0)
{
- viewer.sendChimeraCommand(resetLastRes.toString(), false);
+ eval.setLength(0);
+ eval.append(resetLastRes.toString() + ";");
}
- eval.setLength(0);
eval.append("display "); // +modelNum
resetLastRes.setLength(0);
resetLastRes.append("~display ");
{
eval.append(" #" + (mdlNum));
- resetLastRes.append("#" + (mdlNum));
+ resetLastRes.append(" #" + (mdlNum));
}
// complete select string
eval.append("." + chain);
resetLastRes.append("." + chain);
}
- eval.append(eval.toString());
-
- resetLastRes.append(resetLastRes.toString()
- );
-
+
viewer.sendChimeraCommand(eval.toString(), false);
viewerCommandHistory(true);
viewer.startListening();