This is a read-only mirror of pymolwiki.org

Difference between revisions of "Flag"

From PyMOL Wiki
Jump to navigation Jump to search
m (3 revisions)
 
(table)
Line 1: Line 1:
 +
[[Flag]] is a command to set or clear ''flags'' on atom sets. A flag is just some atom-specific property. A flag is either on or off for a residue. Possible flags are:
  
[[Flag]] is a command to set or clear ''flags'' on atom sets. A flag is just some atom-specific property. A flag is either on or off for a residue. Possible flags are:
+
{| class="wikitable"
* Flags 0-7 are reserved for molecular modeling
+
|-
'''focus''' = 0
+
! Flag name
::Atoms of Interest (i.e. a ligand in an active site)
+
! Value
'''free''' = 1
+
! Description
::Free Atoms (free to move subject to a force-field)
+
! Notes
'''restrain''' = 2
+
|-
::Restrained Atoms (typically harmonically constrained)
+
| '''focus'''
'''fix''' = 3
+
| 0
::Fixed Atoms (no movement allowed)
+
| Atoms of Interest (i.e. a ligand in an active site)
'''exclude''' = 4
+
|rowspan="6"| Reserved for molecular modeling.
::Atoms which should not be part of any simulation
+
 
+
Affects [[Molecular Sculpting|sculpting]].
*Flags 8-15 are free for end users to manipulate
+
|-
+
| '''free'''
*Flags 16-23 are reserved for external GUIs and linked applications
+
| 1
+
| Free Atoms (free to move subject to a force-field)
* Flags 24-30 are reserved for PyMOL internal usage
+
|-
'''exfoliate''' = 24
+
| '''restrain'''
::Remove surface from atoms when surfacing
+
| 2
'''ignore'''=25
+
| Restrained Atoms (typically harmonically constrained)
::Ignore atoms altogether when surfacing
+
|-
'''no_smooth''' = 26
+
| '''fix'''
::Do not smooth atom position
+
| 3
+
| Fixed Atoms (no movement allowed)
* Flag 31 is reserved for coverage tracking when assigning parameters, etc.
+
|-
   
+
| '''exclude'''
If the 'auto_indicate_flags' setting is true, then PyMOL will automatically create a selection called "indicate" which contains all atoms with that flag after applying the command.
+
| 4
+
| Atoms which should not be part of any simulation
=PYMOL API=
+
|-
<source lang="python">  
+
| '''study'''
cmd.flag(int flag, string selection, string action="reset", int indicate=0)
+
| 5
</source>
+
|
 +
|-
 +
|
 +
| 6
 +
| Protein (<code>polymer.protein</code> selector)
 +
|rowspan="2"| See [[auto_classify_atoms]] and [[auto_show_classified]]
 +
|-
 +
|
 +
| 7
 +
| Nucleic acid (<code>polymer.nucleic</code> selector)
 +
|-
 +
|
 +
| 8-15
 +
| ''Free for end users to manipulate''
 +
|rowspan="2"|
 +
|-
 +
|
 +
| 16-23
 +
| Reserved for external GUIs and linked applications
 +
|-
 +
| '''exfoliate'''
 +
| 24
 +
| Remove surface from atoms when surfacing (redundant with excluding those atoms from the selection in <code>show surface, sele</code>)
 +
|rowspan="2"| Affects [[surface]] (with [[surface_mode]]=0), [[dots]] (with [[trim_dots]]=on), [[Get_Area|get_area]]
 +
|-
 +
| '''ignore'''
 +
| 25
 +
| Ignore atoms altogether when surfacing
 +
|-
 +
| '''no_smooth'''
 +
| 26
 +
| Do not smooth atom position
 +
|rowspan="1"| Affects [[cartoon]]
 +
|-
 +
|
 +
| 27
 +
| Polymer
 +
|rowspan="5"| See [[auto_classify_atoms]] and [[auto_show_classified]]
 +
 
 +
See [[Selection Algebra]] "Chemical classes"
 +
|-
 +
|
 +
| 28
 +
| Solvent
 +
|-
 +
|
 +
| 29
 +
| Organic
 +
|-
 +
|
 +
| 30
 +
| Inorganic
 +
|-
 +
|
 +
| 31
 +
| Guide atom (e.g. CA in proteins)
 +
|}
 +
 
 +
== Usage ==
 +
 
 +
  flag flag, selection [, action [, quiet ]]
 +
 
 +
If the [[auto_indicate_flags]] setting is true, then PyMOL will automatically create a selection called "indicate" which contains all atoms with that flag after applying the command.
 +
 
 +
== Arguments ==
 +
 
 +
* '''flag''' = int or str: Flag name or value
 +
* '''selection''' = str: atom selection
 +
* '''action''' = set|clear|reset: ''Note that "reset" will set the flag on the given selection, and clear it on all other atoms'' {default: reset}
 +
 
 +
== Examples ==
 +
 
 +
[[File:flags-ignore-exfoliate.png|thumb|right|CYS residue with flag "ignore" (left) and flag "exfoliate" (right)]]
 +
 
 +
<syntaxhighlight lang="python">
 +
fab AC
 +
 
 +
# Image on the left
 +
flag ignore, resn CYS
 +
show surface
 +
 
 +
# Image on the right
 +
flag ignore, all, clear
 +
flag exfoliate, resn CYS
 +
rebuild surface
 +
</syntaxhighlight>  
  
= Examples =
 
 
<source lang="python">
 
<source lang="python">
# get the area of a protein-ligand complex
+
# in sculpting, ensure the newMethyl group just added doesn't move around
get_area my_complex
+
flag fix, newMethyl
# ignore the ligands when doing surface area
+
 
flag ignore, organic
+
# Introspect the flags bitmask
# compare the surface area now
+
iterate all, print(hex(flags))
get_area my_complex
 
  
# in sculpting, ensure the newMethyl group just added
+
# Select atoms with "fix" flag
# doesn't move about
+
select fixedatoms, flag 3
flag fix, newMethyl
 
 
</source>
 
</source>
  
 
[[Category:Commands]]
 
[[Category:Commands]]

Revision as of 06:42, 23 June 2020

Flag is a command to set or clear flags on atom sets. A flag is just some atom-specific property. A flag is either on or off for a residue. Possible flags are:

Flag name Value Description Notes
focus 0 Atoms of Interest (i.e. a ligand in an active site) Reserved for molecular modeling.

Affects sculpting.

free 1 Free Atoms (free to move subject to a force-field)
restrain 2 Restrained Atoms (typically harmonically constrained)
fix 3 Fixed Atoms (no movement allowed)
exclude 4 Atoms which should not be part of any simulation
study 5
6 Protein (polymer.protein selector) See auto_classify_atoms and auto_show_classified
7 Nucleic acid (polymer.nucleic selector)
8-15 Free for end users to manipulate
16-23 Reserved for external GUIs and linked applications
exfoliate 24 Remove surface from atoms when surfacing (redundant with excluding those atoms from the selection in show surface, sele) Affects surface (with surface_mode=0), dots (with trim_dots=on), get_area
ignore 25 Ignore atoms altogether when surfacing
no_smooth 26 Do not smooth atom position Affects cartoon
27 Polymer See auto_classify_atoms and auto_show_classified

See Selection Algebra "Chemical classes"

28 Solvent
29 Organic
30 Inorganic
31 Guide atom (e.g. CA in proteins)

Usage

flag flag, selection [, action [, quiet ]]

If the auto_indicate_flags setting is true, then PyMOL will automatically create a selection called "indicate" which contains all atoms with that flag after applying the command.

Arguments

  • flag = int or str: Flag name or value
  • selection = str: atom selection
  • action = set|clear|reset: Note that "reset" will set the flag on the given selection, and clear it on all other atoms {default: reset}

Examples

CYS residue with flag "ignore" (left) and flag "exfoliate" (right)
fab AC

# Image on the left
flag ignore, resn CYS
show surface

# Image on the right
flag ignore, all, clear
flag exfoliate, resn CYS
rebuild surface
# in sculpting, ensure the newMethyl group just added doesn't move around
flag fix, newMethyl

# Introspect the flags bitmask
iterate all, print(hex(flags))

# Select atoms with "fix" flag
select fixedatoms, flag 3