paint_case [property] [#values] [values] [colours]
Colour residue or atomic properties according to discrete values, all in one go. The default is [mol]_atom_z. The following commands will colour the current molecule according to atom name:
paint_case atom_name 5 c* n* o* s* p* white blue red yellow green z ; end
Notice that for the specification of character value properties such as atom names or residue types, you can use the wildcard character * in the specification. Thus, for residue types, T* could be Tyr, Thr or Trp. This is not the case in command, property or colour specification.
Another way to paint atoms according to the type of atom is to use the element number property:
pa_ca atom_z 3 6 7 8 white blue red z ; end
This will colour atoms with Z = 6 (carbon) white, atoms with Z = 7 (nitrogen) blue and atoms with Z = 8 (oxygen) red. The zone containing the whole molecule will be drawn. In fact this way of colouring according to atom type is faster, because there is less computation involved in the comparison, than is the case for character properties like _atom_name. Now let us try to paint according to the charges on residues. To do this, you need to load the residue table containing the charges:
db_table_res charge i table_charge paint_case residue_charge 3 -1 0 1 red white blue z ; end
The latter line could be abbreviated even further:
p_ca r_c 3 -1 0 1 re whi blue z ; end