OK, I thought about this a bit more, and what Rolf wrote is totally
reasonable. Next update involves a HUGE simplification:
bug fix: interpretation of x and @x in select commands and {...} phrases
-- Variable substitution has been unintuitive and inconsistent.
For instance:
x = "C or T"
select @x -- works fine
print {@x} -- fails
The problem is the use of @ to reference the variable NAMED BY another
variable within a math expression (print context) but not a select
context.
For instance:
y = 3
x = "y"
print x --> "y"
print @x --> 3
Such referencing is important for math expressions, but the
extension of this to atom expressions is not necessary and
not generally useful.
-- The current situation is as follows:
x = "A or T"
select @x --> all A and T groups
print {@x} --> nothing (because @x is "the contents of the variable
'A or T'")
-- This fix simplifies the situation by not allowing variable-variable
referencing within atom expressions bounded by braces, just like
within implicit atom expression commands (select, display, hide,
delete, etc.).
-- The result is much more consistent. The following do exactly what
you think they would do:
x = "A or T"
select @x
print {@x}
-- The current way of doing this, by defining a temporary atom
expression using the DEFINE (or @) command still works:
x = "A or T"
@y @x
select y same as select @x
-- Note that the difference between "select x" and "select @x"
may be significant:
ala = "cys"
select ala --> selects all alanines
select @ala --> selects all cysteines
On Fri, Feb 7, 2014 at 12:20 PM, Rolf Huehne <[email protected]> wrote:
> On 02/07/2014 05:51 PM, Robert Hanson wrote:
>
> But why does "print {proteinogenic AND *:A}.size" then still works as in
> version 11.6.8 and results in "2781"?
>
because that's the standard notation.
print {some atom business}.size
So obviously within '{}.size' there is not just looked for atom set
> names but also for atom expressions.
>
in a math expression, {...} is an atom set.
within an atom selection expression, {...} is also an atom set, but { } is
unnecessary
within an atom selection expression, @{...} is a math expression
And why does 'x="protein"; print {@x}.size' also not work, although
> 'protein' is an atom set name?
>
>
it does now
> For me the changes don't look like a bug fix but like a feature removal
> that reduces consistency in the use of variables.
>
> No features removed; definitely a bug fix -- for what I just did now.
> Let's compare the two systems and first take a look at the
> documentation. It says:
>
and look again now: http://chemapps.stolaf.edu/jmol/docs/index.htm#jmolmath
>
> "Variables may be assigned using standard mathematical expressions and
> used throughout Jmol in virtually any script command to substitute for
> parameters using the syntax @varName or @{math expression}"
>
> In both systems (11.6.8 and 14.0.5) it is possible to provide atom
> expressions within variables instead of providing the atom expression
> directly, e.g.:
> selection_expression = "proteinogenic AND *:" + "A";
>
yup
> select @selection_expression
>
> In both systems an atom expression can be used within '{}.size', e.g.:
> print {proteinogenic AND *:A}.size
>
> yup
> In 11.6.8 the atom expression can also be contained within a variable,
> like in other commands, but in 14.0.5 it can not.
>
> in the very early versions of this there were no bitsets - no {...} at
all; everything was just a string.
> Doesn't the system of 11.6.8 look more consistent to you too?
> I hope you will not say that the working of 'print {proteinogenic AND
> *:A}.size' is another bug that has to be removed.
>
>
indeed. I think so, too. It has been fixed.
> I was really glad that atom expressions within variables removed the
> need to define an atom set first and then use it. This helped to make
> several complex scripts less complex and more readable.
> So this feature removal called "bug fix" will break a number of my
> scripts and will require quite some adaptations to make them work again.
>
>
let me know how it goes.
> Regards,
> Rolf
> --
>
> Rolf Huehne
> Postdoc
>
> Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
> Beutenbergstrasse 11
> 07745 Jena, Germany
>
>
>
>
------------------------------------------------------------------------------
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