|
From: DeLano, W. <wa...@su...> - 2002-10-11 23:11:46
|
> From: Xavier I. Ambroggio=20
>=20
> Dr. Delano,
>=20
> First of all, thank you for developing PyMOL. I want to=20
> 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*=20
> 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=20
mycba=20
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=3D"(all)"):
s =3D str(selection) =20
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)
|