Difference between revisions of "Ball and Stick"

From PyMOLWiki
Jump to navigation Jump to search
(Added info about graphical transformations made by the command + changed two deprecated examples.)
Line 14: Line 14:
 
<source lang="python">
 
<source lang="python">
 
# turn on the representation for everything in PyMOL
 
# turn on the representation for everything in PyMOL
preset.ball_and_stick('all')
+
preset.ball_and_stick(selection='all', mode=1)
 +
</source>
 +
 
 +
Parameter ''mode'' can be 1 or 2. With ''mode=1'' you'll have...
 +
<source lang="python">
 +
set_bond stick_color, white, selection, selection
 +
set_bond stick_radius, 0.14, selection, selection
 +
set sphere_scale, 0.25, selection
 +
show sticks, selection
 +
show spheres, selection
 +
</source>
 +
If ''mode=2'' than you'll get...
 +
<source lang="python">
 +
set_bond stick_color, white, selection, selection
 +
set_bond stick_radius, -0.14, selection, selection
 +
set stick_ball, 1
 +
set stick_ball_ratio, -1.0
 +
set stick_ball_color, atomic
 +
show sticks, selection
 
</source>
 
</source>
  
Line 24: Line 42:
 
show sticks
 
show sticks
 
show spheres
 
show spheres
set stick_radius=0.1
+
set stick_radius, 0.1, (all)
set sphere_scale=0.25
+
set sphere_scale, 0.25, (all)
 
</source>
 
</source>
  

Revision as of 09:17, 1 June 2010

Ball and Stick

The ball and stick representation is very often used to display macromolecules. PyMOL allows the user the ability to turn on this representation for certain selections, or roll their own hand-made versions of the command (see below).

Usage

Builtin

GUI

From the PyMOL representation menu choose, "Ball and Stick".

Command Line/API

# turn on the representation for everything in PyMOL
preset.ball_and_stick(selection='all', mode=1)

Parameter mode can be 1 or 2. With mode=1 you'll have...

set_bond stick_color, white, selection, selection
set_bond stick_radius, 0.14, selection, selection
set sphere_scale, 0.25, selection
show sticks, selection
show spheres, selection

If mode=2 than you'll get...

set_bond stick_color, white, selection, selection
set_bond stick_radius, -0.14, selection, selection
set stick_ball, 1
set stick_ball_ratio, -1.0
set stick_ball_color, atomic
show sticks, selection

Hand Made

Balls with sticks really look nice. You can even create your own style of this, with control over sphere_scale and stick_radius.

hide lines
show sticks
show spheres
set stick_radius, 0.1, (all)
set sphere_scale, 0.25, (all)

Also OK:

show sticks
set valence, on
set stick_ball, on
set stick_ball_ratio, 3
set stick_radius, 0.12

You can adjust the two numbers above to your taste.


Ed. As of 0.98bXX there is a GUI-enable Ball & Stick representation available to users. Tree