if (cmd.length() > 0)
cmd.setLength(cmd.length() - 4);
evalStateCommand("~display #*; ~ribbon #*; ribbon " + cmd + ";focus "
- + cmd);
+ + cmd,false);
}
public void closeViewer()
// TODO: colour by chain should colour each chain distinctly across all
// visible models
// TODO: http://issues.jalview.org/browse/JAL-628
- evalStateCommand("select *;color chain");
+ evalStateCommand("select *;color chain",false);
}
public void colourByCharge()
{
colourBySequence = false;
evalStateCommand("colour *;color white;select ASP,GLU;color red;"
- + "select LYS,ARG;color blue;select CYS;color yellow");
+ + "select LYS,ARG;color blue;select CYS;color yellow", false);
}
/**
int[] _refStructure, ColumnSelection[] _hiddenCols)
{
assert (_alignment.length == _refStructure.length && _alignment.length != _hiddenCols.length);
-
+ StringBuffer allComs = new StringBuffer(); // whole shebang for superposition
String[] files = getPdbFile();
// check to see if we are still waiting for Jmol files
long starttime = System.currentTimeMillis();
// reference structure - all others are superposed in it
String[] targetC = new String[files.length];
String[] chainNames = new String[files.length];
+ String[] atomS = new String[files.length];
for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
{
StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);
}
chainNames[pdbfnum] = mapping[m].getPdbId()
+ targetC[pdbfnum];
+ atomS[pdbfnum] = asp.getRNA()!=null ? "P" : "CA";
// move on to next pdb file
s = sequence[pdbfnum].length;
break;
{
molsel.append((run ? "" : ":") + lpos);
molsel.append(chainCd);
- // molsel.append("} {");
- // molsel.append(",");
+ molsel.append(",");
}
}
else
{
selcom[pdbfnum] = molsel.toString();
selectioncom.append("#" + pdbfnum);
- selectioncom.append(selcom[pdbfnum].substring(1,
- selcom[pdbfnum].length() - 1));
+ selectioncom.append(selcom[pdbfnum]);
selectioncom.append(" ");
if (pdbfnum < files.length - 1)
{
- selectioncom.append("|");
+ selectioncom.append("| ");
}
}
else
{
continue;
}
- command.append("match ");
+ if (command.length()>0)
+ {
+ command.append(";");
+ }
+ command.append("match");
// form the matched pair strings
for (int s = 0; s < 2; s++)
{
+ command.append(" #"+(s == 0 ? pdbfnum : refStructure)+".1");
+ // note - need to select on first model, otherwise it all goes wrong!
command.append(selcom[(s == 0 ? pdbfnum : refStructure)]);
+ command.append("@"+atomS[(s == 0 ? pdbfnum : refStructure)]); // match on backbone alpha/polyphosphate
}
}
if (selectioncom.length() > 0)
{
System.out.println("Select regions:\n" + selectioncom.toString());
- evalStateCommand("~display *; trace *; ribbons "
- + selectioncom.toString() + "");
- // selcom.append("; ribbons; ");
System.out
.println("Superimpose command(s):\n" + command.toString());
-
- evalStateCommand(command.toString());
+ allComs.append("~display all; chain @CA|P; ribbon "
+ + selectioncom.toString() + ";"+command.toString());
+ // selcom.append("; ribbons; ");
}
}
if (selectioncom.length() > 0)
selectioncom.setLength(selectioncom.length() - 1);
}
System.out.println("Select regions:\n" + selectioncom.toString());
- evalStateCommand("~display *; trace *; ribbons "
+ allComs.append("; ~display all; chain @CA|P; ribbon "
+ selectioncom.toString() + "");
// evalStateCommand("select *; backbone; select "+selcom.toString()+"; cartoons; center "+selcom.toString());
+ evalStateCommand(allComs.toString(),false);
}
+
}
private void checkLaunched()
}
}
- public void evalStateCommand(final String command)
+ public void evalStateCommand(final String command, boolean resp)
{
viewerCommandHistory(false);
checkLaunched();
// @Override
// public void run()
// {
- lastReply = viewer.sendChimeraCommand(command, true);
+ lastReply = viewer.sendChimeraCommand(command, resp);
if (debug)
{
log("Response from command ('" + command + "') was:\n"
alignment))
for (String cbyseq : cpdbbyseq.commands)
{
- evalStateCommand(cbyseq);
+ waitForChimera();
+ evalStateCommand(cbyseq, false);
+ waitForChimera();
}
}
+ private void waitForChimera()
+ {
+ while (viewer.isBusy())
+ {
+ try {
+ Thread.sleep(15);
+ } catch (InterruptedException q)
+ {}
+ }
+ }
+
public boolean isColourBySequence()
{
return colourBySequence;
int mdlNum = cms.get(0).getModelNumber();
viewerCommandHistory(false);
- viewer.stopListening();
+ // viewer.stopListening();
if (resetLastRes.length() > 0)
{
eval.setLength(0);
viewer.sendChimeraCommand(eval.toString(), false);
viewerCommandHistory(true);
- viewer.startListening();
+ // viewer.startListening();
}
}
+ col.getGreen() + "," + col.getBlue() + "];");
}
- evalStateCommand(command.toString());
+ evalStateCommand(command.toString(),false);
viewerCommandHistory(true);
}