I believe the confusion is caused by the simplified selection expression 
in PyMOL (and some other visualization tools as well). I remember that 
one of my colleagues once questioned strongly the reason of using OR 
instead of AND in such situation.

The expression:

select resn GLU or resn ASP

actually means

select (resn == GLU) or (resn == ASP)

The reason of using Boolean operator *or* is very clean when the two 
operands are stated completely. But when the operands are simplified, 
our first reaction is to use *and* because it is very natural to say

"I want GLU *and* ASP"

if you want both GLU and ASP.

And it is even more confusing in Jmol :

select 110 or 112 (select resno==110 or resn==112)

if want you really want is 110 *and* 112 :)

hongbo

On 03/01/2011 05:43 PM, Jason Vertrees wrote:
> Hi Martin,
>
> To select all ASPs and GLUs just type,
>
> select resn GLU+ASP
>
> or
>
> select resn GLU or resn ASP
>
> or, if you need parentheses,
>
> select ((resn GLU) or (resn ASP))
>
>
> Maybe this will help:
>
> # fetch a test protein
>
> fetch 1rsy, async=0
>
> # color all ASPs and GLUs red
>
> color tv_red, (resn ASP or resn GLU)
>
>
> While the boolean 'and' works, the following will fail to select and
> color any atoms:
>
> color tv_red, (resn ASP and resn GLU)
>
> because there will be no _single atom_ in both an ASP and a GLU.  The
> boolean 'and' in "(resn ASP and resn GLU)" requests an atom that is in
> any ASP _and_ in any GLU--which is impossible.
>
> Cheers,
>
> -- Jason
>
>
>
> On Tue, Mar 1, 2011 at 7:44 AM, Martin Hediger<ma....@bluewin.ch>  wrote:
>> Dear all
>> What is the selection syntax to select all GLU and ASP residues within an
>> object?
>>
>> I'm trying it the way its written on the wiki:
>>
>> remove resn hoh    # remove water
>> h_add              # add hydrogens
>>
>> as surface
>> color grey90
>>
>> color slate, resn lys       # lysines in light blue
>> color paleyellow, resn cys  # cysteines in light yellow
>> color tv_red, (resn asp or(resn glu))  # aspartic and glutamic acid in light
>> red
>>
>> but, the selection kind of does not work for me (I'm assuming the operator
>> for the logical AND is 'and').
>> What is it that I need to do differently?
>>
>> Kind regards
>> Martin
>>
>> ------------------------------------------------------------------------------
>> Free Software Download: Index, Search&  Analyze Logs and other IT data in
>> Real-Time with Splunk. Collect, index and harness all the fast moving IT
>> data
>> generated by your applications, servers and devices whether physical,
>> virtual
>> or in the cloud. Deliver compliance at lower cost and gain new business
>> insights. http://p.sf.net/sfu/splunk-dev2dev
>> _______________________________________________
>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>
>
>
>

-- 
Hongbo ZHU
Postdoctoral Researcher
Structural Bioinformatics

Technische Universität Dresden
Biotechnology Center
Tatzberg 47/49
01307 Dresden, Germany

Tel: +49 (0) 351 463-40083
Fax: +49 (0) 351 463-40087
E-Mail:  hongbo.zhu at biotec
Webpage: www.biotec.tu-dresden.de

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to