This is a read-only mirror of pymolwiki.org

Difference between revisions of "Cartoon"

From PyMOL Wiki
Jump to navigation Jump to search
(→‎Adjusting width of cartoon: info for loops; had to google it)
(6 intermediate revisions by the same user not shown)
Line 28: Line 28:
 
Try varying the following.
 
Try varying the following.
  
For strands:
+
For β-strands:
 
<source lang="python">
 
<source lang="python">
 
cartoon_rect_length
 
cartoon_rect_length
Line 34: Line 34:
 
</source>
 
</source>
  
For helices:
+
For &alpha;-helices:
 
<source lang="python">
 
<source lang="python">
 
cartoon_oval_length
 
cartoon_oval_length
Line 40: Line 40:
 
</source>
 
</source>
  
or for "fancy" helices:
+
For loops:
<code>
+
<source lang="python">
 +
cartoon_loop_radius
 +
</source>
 +
 
 +
For "fancy" &alpha;-helices:
 +
<source lang="python">
 
cartoon_dumbell_length
 
cartoon_dumbell_length
 
cartoon_dumbell_width
 
cartoon_dumbell_width
 
cartoon_dumbell_radius  (radius of cylinder at edge of helix ribbon)
 
cartoon_dumbell_radius  (radius of cylinder at edge of helix ribbon)
</code>
+
</source>
 +
 
 
In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.
 
In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.
  
Line 60: Line 66:
  
 
[[Image:Cartoon_discrete_color0.png|Discrete Coloring Off|center|thumb]] [[Image:Cartoon_discrete_color1.png|Discrete Coloring On|center|thumb]]
 
[[Image:Cartoon_discrete_color0.png|Discrete Coloring Off|center|thumb]] [[Image:Cartoon_discrete_color1.png|Discrete Coloring On|center|thumb]]
 
  
 
== Sausage Representation ==
 
== Sausage Representation ==
Line 68: Line 73:
 
  unset cartoon_smooth_loops
 
  unset cartoon_smooth_loops
 
  unset cartoon_flat_sheets
 
  unset cartoon_flat_sheets
 +
 +
As of v 0.98 or so, there's a Putty option.  Use this.
 +
 +
[[Image:B_factor_putty.png|thumb|Example of B-factor Putty|center|250px]]
  
 
==Black and White Representation==
 
==Black and White Representation==
Line 81: Line 90:
  
 
I'm sure there are other ways to do this.  If you want to include it in a publication make sure you ray traced it large enough.  For that, see [[:Category:Advanced_Issues_Image_Manipulation_Publication_Quatlity_Images|Creating Publication Quality Images]].
 
I'm sure there are other ways to do this.  If you want to include it in a publication make sure you ray traced it large enough.  For that, see [[:Category:Advanced_Issues_Image_Manipulation_Publication_Quatlity_Images|Creating Publication Quality Images]].
 +
 +
==CA (Alpha Carbon) Trace==
 +
If you have a structure with just a alpha carbon trace, you can get a cartoon by
 +
<source lang="python">
 +
set cartoon_trace,1
 +
show cartoon
 +
</source>
 +
If your structure is more than just the CA backbone, the cartoon representation will look incorrect, so use it just with CA trace.
 +
 +
==Various Transparency Levels==
 +
[[Image:Cartoon_multi_transp.png|thumb|center|Example of Cartoon Multi-level Transparency.  The near cartoon has transparency setting '''0.2''', the segment in the BG '''0.5'''.]]
 +
One can make different cartoon selections have different transparency values, in PyMol.  The trick here is to use "create" instead of "select".  Create makes new objects that can have independent settings. 
 +
 +
<source lang="python">
 +
load mol_obj.pdb
 +
 +
# transfer a piece of the molecule into a new object
 +
 +
create new_obj, chain A
 +
remove mol_obj in new_obj
 +
 +
# adjust trasparency for the new object
 +
 +
set cartoon_transparency, 0.5, new_obj
 +
</source>
 +
 +
== Nucleic Acid Representation ==
 +
[[Image:Nucleic1.png|thumb|center|Showing Nucleic Acids]]
 +
To show nucleic acids in a nicer format do:
 +
<source lang="python">
 +
set cartoon_ring_mode,1
 +
show cartoon
 +
</source>
  
  
 
== See Also ==
 
== See Also ==
[[Cmd cartoon]]
+
[[Displaying_Biochemical_Properties]]
  
 
[[Category:Representations|Cartoon]]
 
[[Category:Representations|Cartoon]]

Revision as of 14:20, 24 October 2005

Cartoon Command

DESCRIPTION

"cartoon" changes the default cartoon for a set of atoms.

USAGE

  cartoon type, (selection)

  type = skip | automatic | loop | rectangle | oval | tube | arrow | dumbbell

PYMOL API

   cmd.cartoon(string type, string selection )

EXAMPLES

  cartoon rectangle,(chain A)
  cartoon skip,(resi 145:156)

NOTES

   the "automatic" mode utilizes ribbons according to the
  information in the PDB HELIX and SHEET records.


Adjusting width of cartoon

Try varying the following.

For β-strands:

cartoon_rect_length
cartoon_rect_width

For α-helices:

cartoon_oval_length
cartoon_oval_width

For loops:

cartoon_loop_radius

For "fancy" α-helices:

cartoon_dumbell_length
cartoon_dumbell_width
cartoon_dumbell_radius  (radius of cylinder at edge of helix ribbon)

In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.


Cartoon Representation Example


Forcing Exact Boundaries in Coloring Secondary Structures

To force PyMol to respect secondary structural elements color-wise (PyMol smooths out colors near color chagnes for a prettier image) use the following PyMol command: set cartoon_discrete_colors, on

Discrete Coloring Off
Discrete Coloring On

Sausage Representation

The familiar sausage representation in PyMol is called, "putty". To enable the putty/sausage view simply do,

show cartoon
cartoon putty
unset cartoon_smooth_loops
unset cartoon_flat_sheets

As of v 0.98 or so, there's a Putty option. Use this.

Example of B-factor Putty

Black and White Representation

For those who want a nifty black and white representation of their protein try the following:

  1. Ray trace your protein of choice in a cartoon representation use a BLACK background
  2. Save the image
  3. Load the image in GIMP.
    Black BG Ribbon
  4. Desaturate or Grayscale the image.
    Grayscale
  5. Run the filter: Filter->Edge-Detect->Edge.
    Edge Detect
  6. Select: Layers->Color->Invert.
    Invert Color
  7. Different methods of edge detection will give you different results. In the last example, I used Laplace Edge-Detect, then painted an all white layer beneath the current layer to achieve the results.
    Comments


I'm sure there are other ways to do this. If you want to include it in a publication make sure you ray traced it large enough. For that, see Creating Publication Quality Images.

CA (Alpha Carbon) Trace

If you have a structure with just a alpha carbon trace, you can get a cartoon by

set cartoon_trace,1
show cartoon

If your structure is more than just the CA backbone, the cartoon representation will look incorrect, so use it just with CA trace.

Various Transparency Levels

Example of Cartoon Multi-level Transparency. The near cartoon has transparency setting 0.2, the segment in the BG 0.5.

One can make different cartoon selections have different transparency values, in PyMol. The trick here is to use "create" instead of "select". Create makes new objects that can have independent settings.

load mol_obj.pdb

# transfer a piece of the molecule into a new object

create new_obj, chain A
remove mol_obj in new_obj

# adjust trasparency for the new object

set cartoon_transparency, 0.5, new_obj

Nucleic Acid Representation

Showing Nucleic Acids

To show nucleic acids in a nicer format do:

 set cartoon_ring_mode,1
 show cartoon


See Also

Displaying_Biochemical_Properties