User Tools

Site Tools



“flag” sets the indicated flag for atoms in the selection and clears the indicated flag for atoms not in the selection.


flag flag, selection [, action ]


action = reset: {default} set flag for atoms in selection and clear it for all others

action = set: set the flag for atoms in selection, leaving other atoms unchanged

action = clear: clear the flag for selected atoms, leaving other atoms unchanged


flag free, (resi 45 x; 6) 


This is primarily useful for passing selection information into Chempy models, which have a 32 bit attribute “flag” which holds this information.

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.


  • Flags 0-7 are reserved for molecular modeling

focus 0 = Atoms of Interest (i.e. a ligand in an active site) \ free 1 = Free Atoms (free to move subject to a force-field) \ restrain 2 = Restrained Atoms (typically harmonically contrained) \ fix 3 = Fixed Atoms (no movement allowed) \ exclude 4 = Atoms which should not be part of any simulation

  • Flags 8-15 are free for end users to manipulate
  • Flags 16-23 are reserved for external GUIs and linked applications
  • Flags 24-30 are reserved for PyMOL internal usage

exfoliate 24 = Remove surface from atoms when surfacing \ ignore 25 = Ignore atoms altogether when surfacing \ no_smooth 26 = Do not smooth atom position

  • Flag 31 is reserved for coverage tracking when assigning parameters, etc.

See Also

command/flag.txt · Last modified: 2013/08/19 21:01 (external edit)