Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Selection Algebra
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == Logical selections can be combined. For example, you might select atoms that are part of chain a, but not residue number 125: <source lang="python"> # selects atoms that are part of chain A, but not residue number 125. select chain A and (not resi 125) # The following two selections are equivalent, select (name CB or name CG1 or name CG2) and chain A # select c-beta's, c-gamma-1's and c-gamma-2's # that are in chain A. select name CB+CG1+CG2 and chain A # select all residues within 5 Ang. or any organic small molecules select br. all within 5 of organic # select helices select ss 'H' # select anything shown as a line select rep lines # select all residues with a b-factor less than 20, within 3 angstroms of any water select br. b<20 & (all within 3 of resn HOH) # select anything colored blue select color blue # select the 1st arginine select first resn ARG # select 1foo's segment G's chain X's residue 444's alpha carbon select 1foo/G/X/444/CA # same thing select 1foo and segi G and c. X and i. 444 and n. CA # select the entire object that residue 23's beta caron is in: select bo. i. 23 and n. CA # select the molecule that chain C is in select bm. c. C </source> Like the results of groups of arithmetic operations, the results of groups of logical operations depend on which operation is performed first. They have an order of precedence. To ensure that the operations are performed in the order you have in mind, use parentheses: <source lang="python">byres ((chain A or (chain B and (not resi 125))) around 5)</source> PyMOL will expand its logical selection out from the innermost parentheses.
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Selection Algebra
(section)
Add topic