> From: Xavier I. Ambroggio
>
> Dr. Delano,
>
> First of all, thank you for developing PyMOL. I want to
> modify the util.py
> to create another color scheme, similar to the util.cba* schemes. How
> would I do this and what would I need to do with the modified util.py
> script to get the PyMOL program to accept the new util.cba*
> command? As
1. Put the code below into a Python file (".py" file).
2. Run the file from within PyMOL ("run filename.py").
3. You can now use your new command as
mycba
or
mycba (atom selection)
You may want to put the code into $HOME/.pymolrc.py (unix) or
$PYMOLPATH/pymolrc.py (windows) so that the new command will always be
available.
--
from pymol import cmd
def mycba(selection="(all)"):
s = str(selection)
cmd.color("magenta","("+s+")")
cmd.color("oxygen","(elem O and "+s+")")
cmd.color("nitrogen","(elem N and "+s+")")
cmd.color("sulfur","(elem S and "+s+")")
cmd.color("hydrogen","(elem H and "+s+")")
cmd.color("pink","(elem C and "+s+")")
cmd.extend("mycba",mycba)