How Can I Create A Color Gradient/Heat Map In Pymol?
1
4
Entering edit mode
13.0 years ago
Andreas ▴ 40

How can I color individual amino acids along a gradient to match my data? I would like to create a heat map that has a continuous gradient from blue-white-red in accordance with my data, broken up in 5 blue and 5 red increments. So for my data between between 0-10%, I want royal blue, 11-20% lighter blue, 21-30% even lighter blue....90-100% bright red.

pymol visualization • 13k views
ADD COMMENT
5
Entering edit mode
13.0 years ago

PyMOL is able to apply gradients to b-factors (usually a measure of the electron density spread, i.e. the mobility of an atom).

It is not uncommon to write custom data in those and then perform a gradient coloring. As you can use Python within PyMOL, the code would look like this:

cmd.alter(selection + " and resi " + residue_number, "b=" + your_score)
cmd.spectrum("b", gradient, selection=selection, minimum=min, maximum=max)

where e.g. select can be "[?]molecule_name[?] and chain [?]A[?]", gradient can be "blue_white_red". To get a list of residue names and numbers use

names = []
cmd.iterate(selection + " and n. ca and !solvent and alt a+\"\"", 
    "names.append(resn)")
nums = []
cmd.iterate(selection + " and n. ca and !solvent and alt a+\"\"", 
    "nums.append(resi)")

You can also specify exact colors in (r,g,b) and apply them individually in order to meet your exact requirements. See the PyMOL wiki for details. You can also reuse some of these scripts.

ADD COMMENT
0
Entering edit mode

@michael can i also use the same method if i want to color the residues according to the conservation.I have the sequence with the scores can i color them according to the score in pymol?

ADD REPLY

Login before adding your answer.

Traffic: 1949 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6