This is a read-only mirror of pymolwiki.org

Difference between revisions of "Ramp New"

From PyMOL Wiki
Jump to navigation Jump to search
 
(Restructuring and addtions.)
Line 4: Line 4:
  
 
In the simplest case, they can be used to color representations based on the potential values found in a map object at the corresponding positions in space.  In another simple case, representations can be colored based on proximity to a target.  Note that since ramp targets must themselves be real objects (not merely selections), the "create" command may be needed in order to generate an appropriate target.  In more complicated cases, they can be used to color representations on one object based atoms found in another.  Ramps can operate recursively.  In other words, the output color  from one ramp can be used as the input color for another.  For example, you could color by map potential within a certain distance of the target object, beyond which, a uniform color is applied.
 
In the simplest case, they can be used to color representations based on the potential values found in a map object at the corresponding positions in space.  In another simple case, representations can be colored based on proximity to a target.  Note that since ramp targets must themselves be real objects (not merely selections), the "create" command may be needed in order to generate an appropriate target.  In more complicated cases, they can be used to color representations on one object based atoms found in another.  Ramps can operate recursively.  In other words, the output color  from one ramp can be used as the input color for another.  For example, you could color by map potential within a certain distance of the target object, beyond which, a uniform color is applied.
 
= Example =
 
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.
 
 
<gallery perrow=3 widths=200 heights=200>
 
Image:Surface_by_prop3.png|Ligand surface colored by distance from some given atom.  The remainder of the protein is hidden to more clearly visualize the calculated distances and surface color
 
Image:Surface_by_prop2.png
 
Image:Surface_by_prop.png
 
</gallery>
 
 
To reproduce the results shown here you must do the following:
 
* obtain a protein
 
* calculate some property for some set of atoms (like distance from some central location) and stuff the values into the b-factor
 
* create a new object from the atoms for which you just measured a property
 
* create a new ramp from the object with ramp_new
 
* set the surface color of the new object
 
  
  
Line 36: Line 20:
 
</source>
 
</source>
 
   
 
   
*'''name''' = string: name of the ramp object
+
*'''ramp_name''' = string: name of the ramp object
 
*'''map_name''' = string: name of the map (for potential) or molecular object (for proximity)
 
*'''map_name''' = string: name of the map (for potential) or molecular object (for proximity)
 
*'''range''' = list: values corresponding to slots in the ramp
 
*'''range''' = list: values corresponding to slots in the ramp
Line 46: Line 30:
 
*'''sigma''' = number: with automatic ranging, how many standard deviations from the mean do we go?
 
*'''sigma''' = number: with automatic ranging, how many standard deviations from the mean do we go?
 
*'''zero''' = integer: with automatic ranging, do we force the central value to be zero?
 
*'''zero''' = integer: with automatic ranging, do we force the central value to be zero?
+
 
= Example =
+
= Examples =
 
== Simple Example ==
 
== Simple Example ==
 
<source lang="python">
 
<source lang="python">
ramp_new e_pot_color, e_pot_map, [-10,0,10], [red,white,blue]
+
ramp_new e_pot_color, e_pot_map, [-10, 0, 10], [red, white, blue]
 +
</source>
 +
This creates a new ramp object named '''e_pot_color''', based on the values of the potential found in '''e_pot_map'''.
 +
<!--
 +
<source lang="python">
 +
load pdbset.pqr
 +
load pdbset_pot.dx
 +
 
 +
ramp_new ramp, pdbset_pot, [ -3, 0, 3]
 +
 
 +
show surface
 +
set surface_ramp_above_mode
 +
set surface_color, ramp, pdbset
 
</source>
 
</source>
 +
<-->
 +
 +
== Elaborate examples ==
 +
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.
 +
 +
<gallery perrow=3 widths=250 heights=250>
 +
Image:Surface_by_prop3.png|Ligand surface colored by distance from some given atom.  The remainder of the protein is hidden to more clearly visualize the calculated distances and surface color
 +
Image:Surface_by_prop2.png
 +
Image:Surface_by_prop.png
 +
</gallery>
  
== Normal Usage ==
+
To reproduce the results shown here you must do the following:
<source lang="python">
+
* obtain a protein
load pdbset1.pqr
+
* calculate some property for some set of atoms (like distance from some central location) and stuff the values into the b-factor
load pdbset_1.dx
+
* create a new object from the atoms for which you just measured a property
 +
* create a new ramp from the object with ramp_new
 +
* set the surface color of the new object
  
load pdbset3.pqr
 
load pdbset_3.dx
 
  
ramp_new ramp1, pdbset_1, [ -3, 0, 3]
+
Another possible application of the ramp_new command can be the representation of the ELF function [http://en.wikipedia.org/wiki/Electron_localization_function]. This function can be calculated with the TopMod software [http://www.lct.jussieu.fr/suite64.html].
ramp_new ramp3, pdbset_3, [ -3, 0, 3]
 
  
show surface
+
* Load the cube file containing the ELF function, e.g. H2O_elf.cube
 +
* Create an isosurface with a contour level of 0.8
 +
<source lang="python">isosurface elf, H2O_elf, 0.8</source>
 +
* Load the cube containing the basin information, e.g. H20_esyn.cube. Basically in this cube for each point in the first cube you have either one of the numbers from 1 to 5. More details on what these numbers mean can be found in the TopMod manual.
 +
* Create a new ramp.
 +
<source lang="python">ramp_new ramp, H2O_esyn, [1, 2, 3, 5], [tv_orange, lightblue, palegreen, deeppurple]</source>
 +
* Assign the color ramp to the ELF isosurface
 +
<source lang="python">set surface_color, ramp, elf</source>
 +
* Rebuild
 +
<source lang="python">rebuild</source>
  
set surface_ramp_above_mode
+
<gallery perrow=2 widths=250 heights=250>
 +
Image:H2O.png|Localization domains of H2O. The bounding isosurfaces are ELF=0.8
 +
Image:BeCl2.png|Localization domains of BeCl2. The bounding isosurfaces are ELF=0.8
 +
</gallery>
  
set surface_color, ramp1, pdbset1
 
set surface_color, ramp3, pdbset3
 
</source>
 
  
 
= See Also =
 
= See Also =

Revision as of 22:14, 4 July 2010

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

Color ramps are extremely powerful but complicated to use.

In the simplest case, they can be used to color representations based on the potential values found in a map object at the corresponding positions in space. In another simple case, representations can be colored based on proximity to a target. Note that since ramp targets must themselves be real objects (not merely selections), the "create" command may be needed in order to generate an appropriate target. In more complicated cases, they can be used to color representations on one object based atoms found in another. Ramps can operate recursively. In other words, the output color from one ramp can be used as the input color for another. For example, you could color by map potential within a certain distance of the target object, beyond which, a uniform color is applied.


Usage

 
# normal PyMOL usage
ramp_new name, map_name [, range [, color [, state [, selection [,
        beyond [, within [, sigma [, zero ]]]]]]]]


# in the API
cmd.ramp_new(string name, string map_name, list range, list color, 
  int state, string selection, float beyond, float
  within, float sigma, int zero, int quiet)
  • ramp_name = string: name of the ramp object
  • map_name = string: name of the map (for potential) or molecular object (for proximity)
  • range = list: values corresponding to slots in the ramp
  • color = list: colors corresponding to slots in the ramp
  • state = integer: state identifier
  • selection = selection: for automatic ranging
  • beyond = number: with automatic ranging, are we excluding values beyond a certain distance from the selection?
  • within = number: with automatic ranging, are we only including valuess within a certain distance from the selection?
  • sigma = number: with automatic ranging, how many standard deviations from the mean do we go?
  • zero = integer: with automatic ranging, do we force the central value to be zero?

Examples

Simple Example

ramp_new e_pot_color, e_pot_map, [-10, 0, 10], [red, white, blue]

This creates a new ramp object named e_pot_color, based on the values of the potential found in e_pot_map.

Elaborate examples

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:

  • obtain a protein
  • calculate some property for some set of atoms (like distance from some central location) and stuff the values into the b-factor
  • create a new object from the atoms for which you just measured a property
  • create a new ramp from the object with ramp_new
  • set the surface color of the new object


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].

  • Load the cube file containing the ELF function, e.g. H2O_elf.cube
  • Create an isosurface with a contour level of 0.8
isosurface elf, H2O_elf, 0.8
  • Load the cube containing the basin information, e.g. H20_esyn.cube. Basically in this cube for each point in the first cube you have either one of the numbers from 1 to 5. More details on what these numbers mean can be found in the TopMod manual.
  • Create a new ramp.
ramp_new ramp, H2O_esyn, [1, 2, 3, 5], [tv_orange, lightblue, palegreen, deeppurple]
  • Assign the color ramp to the ELF isosurface
set surface_color, ramp, elf
  • Rebuild
rebuild


See Also

load, color, create, slice, gradient, Expand_To_Surface