[PyMOL] Color changes during a morph

2013-03-25 Thread Max NANAO
Hi All,
Can anyone tell me how I might change the colors of a specific 
selection during the course of a rigimol generated morph?  I would like 
one domain to go from purple to green, and have so far been unable to 
figure out how to do it.  I tried coloring the different start/final 
states before rigimol-ing but that did not work.  I have also tried to 
script the state coloring, as described 
here:http://www.pymolwiki.org/index.php/Color#Color_States_Individually. 
The problem is that cmd.set(surface_color, newcolor, resi 
430:572, a) for example, where a is the state, does not seem to work at 
all.  i.e. the color is not changed.  The idea was to change the colors 
as follows:

states = 30
for a in range(0,states):
 incr = 1.0/(states-1)
 r = 1.0-a*incr
 g = a*incr
 b = 1.0-a*incr
 col = [+str(r)+,+str(g)+,+str(b)+]
 cmd.set_color(newcolor,col)
 print COL state +str(a+1)+: +col
 cmd.set(surface_color, newcolor, resi 430:572, a)
 cmd.set(sphere_color,newcolor, resi 430:572, a)
 cmd.recolor()

ugly, I know!  this is 64 bit pymol 1.5.0.6 eval for linux.  Thanks in 
advance,

Max


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net


Re: [PyMOL] Color changes during a morph

2013-03-25 Thread Thomas Holder
Hi Max,

you use a named color newcolor and change it's values at each
iteration, but all states refer to this same color. Before I show you
how to fix your script, could you give spectrum_states from the
PyMOLWiki a try? It's a script which does exactly what you want:

http://pymolwiki.org/index.php/Spectrum_states

PyMOL run spectrum_states.py
PyMOL spectrum_states resi 430-572, surface sphere, green magenta

Cheers,
  Thomas

Max NANAO wrote, On 03/25/13 21:27:
 Hi All,
 Can anyone tell me how I might change the colors of a specific 
 selection during the course of a rigimol generated morph?  I would like 
 one domain to go from purple to green, and have so far been unable to 
 figure out how to do it.  I tried coloring the different start/final 
 states before rigimol-ing but that did not work.  I have also tried to 
 script the state coloring, as described 
 here:http://www.pymolwiki.org/index.php/Color#Color_States_Individually. 
 The problem is that cmd.set(surface_color, newcolor, resi 
 430:572, a) for example, where a is the state, does not seem to work at 
 all.  i.e. the color is not changed.  The idea was to change the colors 
 as follows:
 
 states = 30
 for a in range(0,states):
  incr = 1.0/(states-1)
  r = 1.0-a*incr
  g = a*incr
  b = 1.0-a*incr
  col = [+str(r)+,+str(g)+,+str(b)+]
  cmd.set_color(newcolor,col)
  print COL state +str(a+1)+: +col
  cmd.set(surface_color, newcolor, resi 430:572, a)
  cmd.set(sphere_color,newcolor, resi 430:572, a)
  cmd.recolor()
 
 ugly, I know!  this is 64 bit pymol 1.5.0.6 eval for linux.  Thanks in 
 advance,
 
 Max

-- 
Thomas Holder
PyMOL Developer
Schrödinger Contractor

--
Own the Future-Intelreg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net