Hi Chandan -

It seems like you're being limited by the 26 numbered colors in the util.cbc 
function. You could create your own randomized list of evenly-spaced colors, 
something like the following (untested, but should be approximately 
usable--sorry, I'm away from my computer today):

from pymol import cmd
from random import shuffle

my_colors = []

# 5^3 > 100
for i in range (0, 5):
    r = 0.25 * i
    for j in range (0, 5):
        g = 0.25 * j
        for k in range (0, 5):
            b = 0.25 * k
            my_colors.append([r, g, b])

# randomize list
shuffle(my_colors)

# color your chains
for x, c in enumerate(my_chain_list):
    cmd.color(my_colors[x], c)

Hope that helps. 

Cheers,
Jared

--
Jared Sampson
Kong Lab
NYU Medical Center
kong.med.nyu.edu
212-263-7898

Sent from my iPhone

> On Mar 17, 2014, at 8:37 AM, "Thomas Holder" <thomas.hol...@schrodinger.com> 
> wrote:
> 
> Hi Chandan,
> 
> in Incentive PyMOL 1.6 you can use the spectrum command to color by chain 
> (will be enumerated) or by residue number. 
> http://pymolwiki.org/index.php/Spectrum
> 
> In open-source PyMOL, you could use the spectrumany script to color by 
> residue number: http://pymolwiki.org/index.php/Spectrumany
> 
> Cheers,
>  Thomas
> 
>> On 13 Mar 2014, at 03:19, Chandan Choudhury <iitd...@gmail.com> wrote:
>> On Thu, Mar 13, 2014 at 10:21 AM, Jordan Willis <jwillis0...@gmail.com> 
>> wrote:
>> I think...
>> 
>> What is happening is that the color command should take in a name like 
>> “color yellow, i. 1" or a CMYK color vector. When you are saying “color 1” 
>> it is just starting at the first index of CMYK which is black.
>> 
>> There is a command for your problem though. Just say util.color_chains() and 
>> it will color all individual chains a different color.
>> 
>> Thanks Jordon for the reply. 
>> 
>> I tried using util.color_chains(). It colors differently upto chain no. 26. 
>> After 26 all the chains are of same color, as I donot have chain no after 
>> that.
>> Some utility which can color by residue number would be very useful.
>> 
>> Chandan
>> 
>>> On Mar 12, 2014, at 11:15 PM, Chandan Choudhury <iitd...@gmail.com> wrote:
>>> 
>>> Dear PyMOL users,
>>> 
>>> I build 100 chains of polymer in a box. Residue number is different for 
>>> every chain. Chain 1 hasresidue no. 1, chain 2 has residue no. 2 and so on. 
>>> I want to color each chain differently.
>>> So, I wrote a script which generates a pml file, and opening this pml file 
>>> with PyMOL should color each chain differently.
>>> 
>>> ##color.pml
>>> load 128md_c.pdb
>>> select 1, i. 1
>>> color  1, i. 1
>>> select 2, i. 2
>>> color  2, i. 2
>>> select 3, i. 3
>>> color  3, i. 3
>>> select 4, i. 4
>>> color  4, i. 4
>>> select 5, i. 5
>>> color  5, i. 5
>>> select 6, i. 6
>>> color  6, i. 6
>>> select 7, i. 7
>>> ...
>>> ...
>>> color  125, i. 125
>>> select 126, i. 126
>>> color  126, i. 126
>>> select 127, i. 127
>>> color  127, i. 127
>>> select 128, i. 128
>>> color  128, i. 128
>>> 
>>> I have 128 chains.
>>> 
>>> What I find that mostly green or black dominates the coloring.
>>> While displaying color by the numeric code, what is the maximum no, after 
>>> which the color repeats?
>>> 
>>> Chandan
>>> 
>>> --
>>> Chandan Kumar Choudhury
>>> National Chemical Laboratory, Pune
>>> India
> 
> -- 
> Thomas Holder
> PyMOL Developer
> Schrödinger, Inc.
> 
> 
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> 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

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the 
intended recipient(s) and may contain information that is proprietary, 
confidential, and exempt from disclosure under applicable law. Any unauthorized 
review, use, disclosure, or distribution is prohibited. If you have received 
this email in error please notify the sender by return email and delete the 
original message. Please note, the recipient should check this email and any 
attachments for the presence of viruses. The organization accepts no liability 
for any damage caused by any virus transmitted by this email.
=================================


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
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

Reply via email to