Difference between revisions of "Label"

From PyMOLWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
===DESCRIPTION===
 
===DESCRIPTION===
    "label" labels one or more atoms properties over a selection using
+
'''label''' labels one or more atoms properties over a selection using the python evaluator with a separate name space for each atom.  The symbols defined in the name space are:
  the python evaluator with a separate name space for each atom.  The
+
  name, resn, resi, chain, q, b, segi, type (ATOM,HETATM)  
  symbols defined in the name space are:
+
formal_charge, partial_charge, numeric_type, text_type  
   
+
All strings in the expression must be explicitly quoted.  This operation typically takes several seconds per thousand atoms altered.  To clear labels, simply omit the expression or set it to ''.
      name, resn, resi, chain, q, b, segi, type (ATOM,HETATM)  
+
 
      formal_charge, partial_charge, numeric_type, text_type
 
 
  All strings in the expression must be explicitly quoted.  This
 
  operation typically takes several seconds per thousand atoms
 
  altered.
 
   
 
  To clear labels, simply omit the expression or set it to ''.
 
 
 
===USAGE===
 
===USAGE===
 
  label (selection),expression
 
  label (selection),expression
Line 22: Line 14:
  
 
===Users Comments===
 
===Users Comments===
 +
====Labels Using ID Numbers====
 
The following commnent,
 
The following commnent,
 
  label SELECTION, " %s" % ID  
 
  label SELECTION, " %s" % ID  
Line 29: Line 22:
 
  label SELECTION, " %s:%s %s" % (resi, resn, name)
 
  label SELECTION, " %s:%s %s" % (resi, resn, name)
 
which will give you something like "GLU:139 CG"
 
which will give you something like "GLU:139 CG"
   
+
 
 +
====Lables Using Three Letter Abbreviations====
 +
* First, Add this to your $HOME/.pymolrc file:
 +
<source lang="python">
 +
# start $HOME/.pymolrc modification
 +
one_letter =3D {'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \
 +
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y',    \
 +
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A',    \
 +
'GLY':'G', 'PRO':'P', 'CYS':'C'}
 +
# end modification
 +
</source>
 +
 
 +
*. Second, instead of:
 +
label n. ca, resn
 +
use:
 +
label n. ca, one_letter[resn]
 +
 
 
[[Category:Commands|label]]
 
[[Category:Commands|label]]

Revision as of 08:19, 9 June 2005

DESCRIPTION

label labels one or more atoms properties over a selection using the python evaluator with a separate name space for each atom. The symbols defined in the name space are:

name, resn, resi, chain, q, b, segi, type (ATOM,HETATM) 
formal_charge, partial_charge, numeric_type, text_type 

All strings in the expression must be explicitly quoted. This operation typically takes several seconds per thousand atoms altered. To clear labels, simply omit the expression or set it to .

USAGE

label (selection),expression

EXAMPLES

label (chain A),chain
label (n;ca),"%s-%s" % (resn,resi)
label (resi 200),"%1.3f" % partial_charge

Users Comments

Labels Using ID Numbers

The following commnent,

label SELECTION, " %s" % ID 

labels the SELECTION with atom ID numbers.

You can make more complicated selections/lables such as

label SELECTION, " %s:%s %s" % (resi, resn, name)

which will give you something like "GLU:139 CG"

Lables Using Three Letter Abbreviations

  • First, Add this to your $HOME/.pymolrc file:
# start $HOME/.pymolrc modification
one_letter =3D {'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y',    \
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A',    \
'GLY':'G', 'PRO':'P', 'CYS':'C'}
# end modification
  • . Second, instead of:
label n. ca, resn

use:

label n. ca, one_letter[resn]