OK, so there is something subtle going on here with the variables. I think
you are hitting a bug fix, actually. So how does this work?
*load =1crnx = "cys"print xcysprint @xselect x0 atoms selectedselect @x36
atoms selected*
What is going on here?
a) *print x* does just that. It prints "cys".
b) *print @x* says "print the contents of the variable named by x." Since
the variable "cys" is not defined, the answer is the empty string.
c) *select x* would be fine if x is defined to be an actual atom set, but
it is not. It is a string. So nothing is selected.
d) *select @x* is a command with a variable argument. When it is executed,
"cys" is first substituted in for "@x". The result is
* select "cys" *
which works just fine.
So, what happens with:
*print {@selection_expression}.size*
?
Well, as the command is parsed, *selection_expression* is evaluated and
found to be "proteinogenic AND *:A". The command then *looks for a variable
by that name* and of course finds nothing. So the answer is "no atoms."
So the real question is this:
*I have a variable that is the string form of an atom expression: "cys and
:A", for instance. How do I get the atom expression itself in a variable?*
x = "cys and :A"
The answer may surprise you. The key is the old Jmol DEFINE command:
*define x @xprint {x}.size36*
See how that works? First *@x* is evaluated and found to be the string "cys
and :A". Then the define command takes that string and defines x to be a
set of atoms.
Now there are actually two "x" variables defined -- one in Jmol math as the
string "cys" and one as the old atom expression definition. So we still have
*print x*
*cys*
but now we also have
*print {x}({14:25 110:115 182:187 223:228 276:281})*
That's because x is now defined both in terms of an atom set for the
context of atom expression commands such as select, display, delete, which
implicitly use the context {x} and so don't need the braces. This goes back
to the old old Jmol @ define command, the predates any Jmol Math stuff. The
rule, when Jmol Math was started, was "in and atom expression, if x is
defined by the DEFINE command use that, but if it isn't, *then* go look to
see if it is an atom expression.
We could also write this:
*@x @x*by the way.
:)
Bob
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users