Ramp New

From PyMOLWiki
(Redirected from Ramp new)
Jump to: navigation, search

ramp_new creates a color ramp based on a map potential value or based on proximity to a molecular object.

Contents

Usage

ramp_new name, map_name [, range [, color [, state [, selection [,
       beyond [, within [, sigma [, zero ]]]]]]]]

Color and range interpretation

Number of colors and values

Supported special colors

With proximity ramps, in addition to regular named colors (like "blue"), the following special colors are supported:

Examples

Color surface by an APBS calculated electrostatic map

Example map: http://pymol.org/tmp/1ubq_apbs.dx

load 1ubq_apbs.dx, e_pot_map
fetch 1ubq, async=0
as surface
 
ramp_new e_pot_color, e_pot_map, [-5, 0, 5], [red, white, blue]
set surface_color, e_pot_color
set surface_ramp_above_mode

Color binding pocket by proximity to ligand

fetch 1rx1, async=0
extract ligand, organic
color blue, ligand
show surface
 
ramp_new prox, ligand, [4, 8], [red, yellow]
color prox, 1rx1

Color isosurface by closest atom

See also the huge surfaces example.

Color the isosurface within 2 Angstrom of the protein (without solvent) by atom colors. Everything beyond 2 Angstrom will be gray.

fetch 1rx1, map, async=0, type=2fofc
isosurface surf, map
 
fetch 1rx1, mol, async=0
remove solvent
 
ramp_new prox, mol, [0, 2, 2], [atomic, atomic, gray]
color prox, surf

Updating the atom colors is possible, for example:

spectrum
recolor

More user provided examples

Ramp + Distance Measure

Using a ramp and a distance measure, we can color the surface by some property--here, I'll chose distance from some important atom in the receptor to the ligand atom.

To reproduce the results shown here you must do the following:


Another possible application of the ramp_new command can be the representation of the ELF function [1]. This function can be calculated with the TopMod software [2].

isosurface elf, H2O_elf, 0.8
ramp_new ramp, H2O_esyn, [1, 2, 3, 5], [tv_orange, lightblue, palegreen, deeppurple]
set surface_color, ramp, elf
rebuild

Surface Colored by Distance from a Point

See Spectrum for another method that allows for more flexible coloring schemes, but needs more work to get there.

This example shows how to color a protein surface by its distance from a given point:

# fetch a friendly protein
 
fetch 1hug, async=0
 
# show it as a surface
 
as surface
 
# create a pseudoatom at the origin; we will
# measure the distance from this point
 
pseudoatom pOrig, pos=(0,0,0), label=origin
 
# create a new color ramp, measuring the distance
# from pOrig to 1hug, colored as rainbow
 
ramp_new proximityRamp, pOrig, selection=1hug, range=[5,65], color=rainbow
 
# set the surface color to the ramp coloring
 
set surface_color, proximityRamp, 1hug
 
# some older PyMOLs need this recoloring/rebuilding
 
recolor; rebuild

Coloring a Viral Capsid by Distance from Core

# create a pseudoatom at the origin-- we will
# measure the distance from this point
 
pseudoatom pOrig, pos=(0,0,0), label=origin
 
# fetch and build the capsid
 
fetch 2xpj, async=0, type=pdb1
split_states 2xpj
delete 2xpj
 
# show all 60 subunits it as a surface
# this will take a few minutes to calculate
 
as surface
 
# create a new color ramp, measuring the distance
# from pOrig to 1hug, colored as rainbow
 
ramp_new proximityRamp, pOrig, selection=(2xpj*), range=[110,160], color=rainbow
 
# set the surface color to the ramp coloring
 
set surface_color, proximityRamp, (2xpj*)
 
# some older PyMOLs need this recoloring/rebuilding
 
recolor

See Also

load, color, create, slice, gradient, Expand_To_Surface

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox