My software notes

November 27, 2007

[pymol] example– coloring surface by b-factor

Filed under: pymol/ molmol — kpwu @ 9:16 pm

I want to make a model that represents protein surface with some features and use b-factor column to draw a color gradient. I searched online a while and had steps showing here, also, an picture showing my result.

Steps.

1. download data2bfactor.py (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)

2. make a file that have such information:
(res chain AA(capitalized) b-factor) <– skip this line
1 A MET 0.0
2 A GLU 0.1
3 A LYS 0.2
……………………

3. open pymol, load the PDB, and draw some residues in surface

4. import the b-factor into the PDB by typing:
data2b_res ‘selection’, ‘b-factor file’

5. use “spectrum” to draw the color gradient:
spectrum b, yellow_blue,resi 10-130,minimum=0, maximum=1

6. The example is showing here:

the combinations of color gradient provided by pymol are:
blue_green
blue_magenta
blue_red
blue_white_green
blue_white_magenta
blue_white_red
blue_white_yellow
blue_yellow
cbmr
cyan_magenta
cyan_red
cyan_white_magenta
cyan_white_red
cyan_white_yellow
cyan_yellow
gcbmry
green_blue
green_magenta
green_red
green_white_blue
green_white_magenta
green_white_red
green_white_yellow
green_white_red
green_white_yellow
green_yellow
green_yellow_red
magenta_blue
magenta_cyan
magenta_green
magenta_white_blue
magenta_white_cyan
magenta_white_green
magenta_white_yellow
magenta_yellow
rainbow
rainbow2
rainbow2_rev
rainbow_cycle
rainbow_cycle_rev
rainbow_rev
red_blue
red_cyan
red_green
red_white_blue
red_white_cyan
red_white_green
red_white_yellow
red_yellow
red_yellow_green
rmbc
yellow_blue
yellow_cyan
yellow_cyan_white
yellow_green
yellow_magenta
yellow_red
yellow_white_blue
yellow_white_green
yellow_white_magenta
yellow_white_red
yrmbcg

Advertisements

6 Comments »

  1. Dear friend i would like to
    know where to save the file for
    B-factor
    becoz the path am giving is saying
    ERROR

    Comment by Ramakrishna — January 13, 2008 @ 12:13 am | Reply

  2. I don’t get it clearly.
    Your problem is :

    1. you have a b-factor file, but you can’t import the file into the current PDB you opened by PyMol?
    –> make sure the path is right, use absolute path. e.g. /home/user/pymol-data/1pdb.bfactor
    or

    2. You have successfully imported your b-factor file into the PDB opened by PyMol, but don’t know how to save?
    –> use PyMol’s “save file” function, save as a new PDB.

    hope it help.

    Comment by kpwu — January 13, 2008 @ 11:54 am | Reply

  3. With the version of pymol that I am using (1.1) I do not need to import any other files or use data2bfactor.py. After loading in my PDB file, I just ran:
    spectrum b, gcbmry,selection=something,minimum=30, maximum=100

    Of course, you would want your own selection and B-factor range. Plus, gcbmry is perhaps not the best choice for a B-factor gradient.

    Thanks for pointing me in the right direction!

    Comment by Jeffrey Wilson — February 12, 2009 @ 12:04 pm | Reply

  4. […] The figure below was drew using command “spectrum count, red_white_blue, all“. (more pymol built-in color schemes are listed at my older post: [pymol] example– coloring surface by b-factor). […]

    Pingback by [PyMOL] custom spectrum colors « My software notes — September 11, 2012 @ 12:29 am | Reply

  5. Just a quick point: the order of the columns here didn’t work for me using data2bfactor.py 2013 version. Actual column format should be chain, residue, amino acid, data value

    C R AAA X

    eg: C 15 ALA 1.34

    Comment by Steve Barratt — January 23, 2014 @ 5:34 pm | Reply

  6. […] tutorial on coloring a protein cartoon expands on info from a few other blog […]

    Pingback by PyMOL Color By Data – Structural Biology Hints and Tips — April 12, 2017 @ 10:13 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: