https://pymolwiki.org/api.php?action=feedcontributions&user=Wayne461&feedformat=atomPyMOLWiki - User contributions [en]2024-03-28T21:25:00ZUser contributionsMediaWiki 1.35.7https://pymolwiki.org/index.php?title=Set_Color&diff=12314Set Color2016-03-06T22:37:25Z<p>Wayne461: </p>
<hr />
<div>[[Set_Color]] defines a new color with color indices (0.0-1.0). Numbers between 0 an 255 can be used as well. (If at least one value is larger than 1, pymol will interpret all 3 values as between 0 and 255). If an existing color name is used, the old color will be overridden. <br />
<br />
===USAGE===<br />
<source lang="python"><br />
set_color name, [ red-float, green-float, blue-float ]<br />
set_color name = [ red-float, green-float, blue-float ] #(DEPRECATED)<br />
</source><br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.set_color( string name, float-list rgb )<br />
</source><br />
<br />
===EXAMPLES===<br />
<source lang="python"><br />
PyMOL>set_color red, [1,0.01,0.01]<br />
Color: "red" defined as [ 1.000, 0.010, 0.010 ].<br />
PyMOL>set_color khaki, [195,176,145]<br />
Color: "khaki" defined as [ 0.765, 0.690, 0.569 ].<br />
</source><br />
<br />
These will be added to the end of the list of Pymol's color indices that you can view the [[Get Color Indices]] command.<br />
<br />
== See Also ==<br />
* [[Get_Color_Tuples]]<br />
<br />
[[Category:Commands|Set Color]]<br />
[[Category:Coloring|Set Color]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12313Get Color Indices2016-03-06T22:31:55Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices. The Pymol names can be used to designate color for objects, see [[Color]].<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
Tangentially related is the fact you can name additional colors,<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
See [[Set Color]] for more details and examples.<br />
The colors created will be added to the end of the list of Pymol's color indices that you can view the '''get_color_indices()''' command.<br />
<br />
<br />
== See Also ==<br />
* [[Get_Color_Tuples]]<br />
* [[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12312Get Color Indices2016-03-06T22:30:44Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices. The Pymol names can be used to designate color for objects, see [[Color]].<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
Tangentially related is the fact you can name additional colors,<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
These will be added to the end of the list of Pymol's color indices that you can view the '''get_color_indices()''' command.<br />
See [[Set Color]] for more details and examples.<br />
<br />
== See Also ==<br />
* [[Get_Color_Tuples]]<br />
* [[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Advanced_Coloring&diff=12310Advanced Coloring2016-03-02T21:23:01Z<p>Wayne461: </p>
<hr />
<div>=Coloring Molecules=<br />
<br />
==Basic Coloring==<br />
Any molecule in PyMOL can be assigned a color using the small rightmost buttons in the object list (in the upper right part of the main GUI window. The [[Color]] command will do the same.<br />
<br />
PyMOL has a predefined set of colors that can be edited in the ''Settings->Colors'' menu. <br />
Alternatively, you can use the [[Set_Color]] command. <br />
<br />
<br />
<br />
==Coloring secondary structures==<br />
To assign helices, sheets and loops individual colors, do:<br />
<source lang="python"><br />
color red, ss h<br />
color yellow, ss s<br />
color green, ss l+''<br />
</source><br />
<br />
When the colour bleeds from the ends of helices and sheets into loops, do:<br />
<source lang="python"><br />
set cartoon_discrete_colors, 1<br />
</source><br />
Or activate ''Cartoon -> Discrete Colors'' in the GUI menu.<br />
<br />
==Coloring by atom type==<br />
The util.cba* ("Color By Atom") commands color atoms according to type: oxygen in red, nitrogen in blue, hydrogen in white. Carbon will get a different colors, depending on the command:<br />
{|<br />
! command<br />
! carbon color<br />
|-<br />
| util.cba'''g'''<br />
| green<br />
|-<br />
| util.cba'''c'''<br />
| cyan<br />
|-<br />
| util.cba'''m'''<br />
| light magenta<br />
|-<br />
| util.cba'''y'''<br />
| yellow<br />
|-<br />
| util.cba'''s'''<br />
| salmon<br />
|-<br />
| util.cba'''w'''<br />
| white/grey<br />
|-<br />
| util.cba'''b'''<br />
| slate<br />
|-<br />
| util.cba'''o'''<br />
| bright orange<br />
|-<br />
| util.cba'''p'''<br />
| purple<br />
|-<br />
| util.cba'''k'''<br />
| pink<br />
|}<br />
For instance:<br />
<source lang="python"><br />
util.cbay three<br />
</source><br />
will color the object ''three'' by atom type, with the carbon atoms in yellow.<br />
<br />
The util.cnc command will color all the atoms according to type, as in the util.cba* commands stated above, except for the C-atoms.<br />
<br />
For instance:<br />
<source lang="python"><br />
util.cnc three<br />
</source><br />
will color the object ''three'' by atom type, but leave the color of the C-atom unaltered.<br />
<br />
==CMYK-safe Colors==<br />
There are two distinct color spaces on computers: RGB (red-green-blue), which is for screens, and CMYK (cyan-magenta-yellow-black), which is for printing.<br />
Some RGB triplets do not have equivalents in CMYK space. As a result, a figure that looks great on a screen can come out with unpredictable colors when printed.<br />
<br />
Most applications do a good job with RGB-to-CMYK conversions for photos, but do not do such a good job with graphics that use pure primary colors. For example, reds are generally OK, but pure blues and greens do not translate very well.<br />
<br />
Here are some RGB values that are within the CMYK gamut (i.e. are "CMYK-safe"):<br />
<source lang="python"><br />
#optimized rgb values for cmyk output:<br />
set_color dblue= [0.05 , 0.19 , 0.57]<br />
set_color blue= [0.02 , 0.50 , 0.72]<br />
set_color mblue= [0.5 , 0.7 , 0.9 ]<br />
set_color lblue= [0.86 , 1.00 , 1.00]<br />
<br />
set_color green= [0.00 , 0.53 , 0.22]<br />
set_color lgreen=[0.50 , 0.78 , 0.50]<br />
set_color yellow=[0.95 , 0.78 , 0.00]<br />
set_color orange=[1.00 , 0.40 , 0.0 ]<br />
<br />
# these are trivial<br />
set_color red= [1.00 , 0.00 , 0.00]<br />
set_color mred= [1.00 , 0.40 , 0.40]<br />
set_color lred= [1.00 , 0.80 , 0.80]<br />
set_color vlred= [1.00 , 0.90 , 0.90]<br />
set_color white= [1.00 , 1.00 , 1.00]<br />
set_color vlgray=[0.95 , 0.95 , 0.95]<br />
set_color lgray= [0.90 , 0.90 , 0.90]<br />
set_color gray= [0.70 , 0.70 , 0.70]<br />
set_color dgray= [0.50 , 0.50 , 0.50]<br />
set_color vdgray=[0.30 , 0.30 , 0.30]<br />
set_color black= [0.00 , 0.00 , 0.00]<br />
##<br />
</source><br />
<br />
Note that there are default atom colors such as "carbon", "nitrogen", "oxygen", "hydrogen", "sulfur", etc. which should also be redefined:<br />
<source lang="python"><br />
set_color carbon= [0.00 , 0.53 , 0.22]<br />
etc.<br />
</source><br />
<br />
==Coloring with 'chainbows' from a script==<br />
The chainbow function can be invoked by:<br />
<source lang="python"><br />
util.chainbow("object-name")<br />
</source><br />
<br />
<br />
==Assign color by B-factor==<br />
B-factor coloring can be done with the [[spectrum]] command. Example:<br />
<br />
spectrum b, blue_white_red, minimum=20, maximum=50<br />
as cartoon<br />
cartoon putty<br />
<br />
= See Also =<br />
[[Color]], [[Spectrum]]<br />
<br />
==Creating a Color bar==<br />
To show a vertical/horizontal color bar indiacting the b-factor variation, use the script pseudobar.pml on the structure pseudobar.pdb, or do the following:<br />
# Create a pdb-file which contains CA positions only, whereas the numbers correspond to your wanted increments of colors. Be sure that CA's are separated by a contant value, say 5 Angstroem.<br />
# Load this new pseudobar-pdb file into PyMOL, make bonds between increment 1 and increment 2 [increment 2 and increment 3 and so on...], define/assign a smooth color for each increment (copy colors definition from automatically created colors made by b-factor script) and show the b-factor bar as lines (or sticks).<br />
<br />
Also, see the newly created [[spectrumbar]] script!<br />
<br />
==Coloring insides and outsides of helices differently==<br />
The inside of helices can be adressed with:<br />
<source lang="python"><br />
set cartoon_highlight_color, red<br />
</source><br />
<br />
<br />
==Coloring all objects differently==<br />
Is there a simple way to colour each object currently loaded, with a different colour?<br />
There is a script [[Color_Objects |color_obj.py]] that does the job.<br />
<br />
USAGE<br />
<br />
color_obj(rainbow=0)<br />
<br />
This function colours each object currently in the PyMOL heirarchy<br />
with a different colour. Colours used are either the 22 named<br />
colours used by PyMOL (in which case the 23rd object, if it exists,<br />
gets the same colour as the first), or are the colours of the rainbow<br />
<br />
==List the color of atoms==<br />
To retrieve the color for all residues in a selection, you can iterate over it from the PyMOL command line<br />
<source lang="python"><br />
iterate all, print color<br />
</source><br />
In Python, it looks like this:<br />
<source lang="python"><br />
import pymol<br />
pymol.color_list = []<br />
cmd.iterate('all', 'pymol.color_list.append(color)')<br />
print pymol.color_list<br />
</source><br />
<br />
The colors listed will be in terms of Pymol indexing system, see [[Get Color Indices]] for converting to names or rgb values.<br />
<br />
== See also ==<br />
* [[Ramp_New]]<br />
<br />
<br />
[[Category:Publication_Quality|Advanced Coloring]]<br />
[[Category:Coloring|Advanced Coloring]]</div>Wayne461https://pymolwiki.org/index.php?title=Advanced_Coloring&diff=12309Advanced Coloring2016-03-02T21:20:57Z<p>Wayne461: </p>
<hr />
<div>=Coloring Molecules=<br />
<br />
==Basic Coloring==<br />
Any molecule in PyMOL can be assigned a color using the small rightmost buttons in the object list (in the upper right part of the main GUI window. The [[Color]] command will do the same.<br />
<br />
PyMOL has a predefined set of colors that can be edited in the ''Settings->Colors'' menu. <br />
Alternatively, you can use the [[Set_Color]] command. <br />
<br />
<br />
<br />
==Coloring secondary structures==<br />
To assign helices, sheets and loops individual colors, do:<br />
<source lang="python"><br />
color red, ss h<br />
color yellow, ss s<br />
color green, ss l+''<br />
</source><br />
<br />
When the colour bleeds from the ends of helices and sheets into loops, do:<br />
<source lang="python"><br />
set cartoon_discrete_colors, 1<br />
</source><br />
Or activate ''Cartoon -> Discrete Colors'' in the GUI menu.<br />
<br />
==Coloring by atom type==<br />
The util.cba* ("Color By Atom") commands color atoms according to type: oxygen in red, nitrogen in blue, hydrogen in white. Carbon will get a different colors, depending on the command:<br />
{|<br />
! command<br />
! carbon color<br />
|-<br />
| util.cba'''g'''<br />
| green<br />
|-<br />
| util.cba'''c'''<br />
| cyan<br />
|-<br />
| util.cba'''m'''<br />
| light magenta<br />
|-<br />
| util.cba'''y'''<br />
| yellow<br />
|-<br />
| util.cba'''s'''<br />
| salmon<br />
|-<br />
| util.cba'''w'''<br />
| white/grey<br />
|-<br />
| util.cba'''b'''<br />
| slate<br />
|-<br />
| util.cba'''o'''<br />
| bright orange<br />
|-<br />
| util.cba'''p'''<br />
| purple<br />
|-<br />
| util.cba'''k'''<br />
| pink<br />
|}<br />
For instance:<br />
<source lang="python"><br />
util.cbay three<br />
</source><br />
will color the object ''three'' by atom type, with the carbon atoms in yellow.<br />
<br />
The util.cnc command will color all the atoms according to type, as in the util.cba* commands stated above, except for the C-atoms.<br />
<br />
For instance:<br />
<source lang="python"><br />
util.cnc three<br />
</source><br />
will color the object ''three'' by atom type, but leave the color of the C-atom unaltered.<br />
<br />
==CMYK-safe Colors==<br />
There are two distinct color spaces on computers: RGB (red-green-blue), which is for screens, and CMYK (cyan-magenta-yellow-black), which is for printing.<br />
Some RGB triplets do not have equivalents in CMYK space. As a result, a figure that looks great on a screen can come out with unpredictable colors when printed.<br />
<br />
Most applications do a good job with RGB-to-CMYK conversions for photos, but do not do such a good job with graphics that use pure primary colors. For example, reds are generally OK, but pure blues and greens do not translate very well.<br />
<br />
Here are some RGB values that are within the CMYK gamut (i.e. are "CMYK-safe"):<br />
<source lang="python"><br />
#optimized rgb values for cmyk output:<br />
set_color dblue= [0.05 , 0.19 , 0.57]<br />
set_color blue= [0.02 , 0.50 , 0.72]<br />
set_color mblue= [0.5 , 0.7 , 0.9 ]<br />
set_color lblue= [0.86 , 1.00 , 1.00]<br />
<br />
set_color green= [0.00 , 0.53 , 0.22]<br />
set_color lgreen=[0.50 , 0.78 , 0.50]<br />
set_color yellow=[0.95 , 0.78 , 0.00]<br />
set_color orange=[1.00 , 0.40 , 0.0 ]<br />
<br />
# these are trivial<br />
set_color red= [1.00 , 0.00 , 0.00]<br />
set_color mred= [1.00 , 0.40 , 0.40]<br />
set_color lred= [1.00 , 0.80 , 0.80]<br />
set_color vlred= [1.00 , 0.90 , 0.90]<br />
set_color white= [1.00 , 1.00 , 1.00]<br />
set_color vlgray=[0.95 , 0.95 , 0.95]<br />
set_color lgray= [0.90 , 0.90 , 0.90]<br />
set_color gray= [0.70 , 0.70 , 0.70]<br />
set_color dgray= [0.50 , 0.50 , 0.50]<br />
set_color vdgray=[0.30 , 0.30 , 0.30]<br />
set_color black= [0.00 , 0.00 , 0.00]<br />
##<br />
</source><br />
<br />
Note that there are default atom colors such as "carbon", "nitrogen", "oxygen", "hydrogen", "sulfur", etc. which should also be redefined:<br />
<source lang="python"><br />
set_color carbon= [0.00 , 0.53 , 0.22]<br />
etc.<br />
</source><br />
<br />
==Coloring with 'chainbows' from a script==<br />
The chainbow function can be invoked by:<br />
<source lang="python"><br />
util.chainbow("object-name")<br />
</source><br />
<br />
<br />
==Assign color by B-factor==<br />
B-factor coloring can be done with the [[spectrum]] command. Example:<br />
<br />
spectrum b, blue_white_red, minimum=20, maximum=50<br />
as cartoon<br />
cartoon putty<br />
<br />
= See Also =<br />
[[Color]], [[Spectrum]]<br />
<br />
==Creating a Color bar==<br />
To show a vertical/horizontal color bar indiacting the b-factor variation, use the script pseudobar.pml on the structure pseudobar.pdb, or do the following:<br />
# Create a pdb-file which contains CA positions only, whereas the numbers correspond to your wanted increments of colors. Be sure that CA's are separated by a contant value, say 5 Angstroem.<br />
# Load this new pseudobar-pdb file into PyMOL, make bonds between increment 1 and increment 2 [increment 2 and increment 3 and so on...], define/assign a smooth color for each increment (copy colors definition from automatically created colors made by b-factor script) and show the b-factor bar as lines (or sticks).<br />
<br />
Also, see the newly created [[spectrumbar]] script!<br />
<br />
==Coloring insides and outsides of helices differently==<br />
The inside of helices can be adressed with:<br />
<source lang="python"><br />
set cartoon_highlight_color, red<br />
</source><br />
<br />
<br />
==Coloring all objects differently==<br />
Is there a simple way to colour each object currently loaded, with a different colour?<br />
There is a script [[Color_Objects |color_obj.py]] that does the job.<br />
<br />
USAGE<br />
<br />
color_obj(rainbow=0)<br />
<br />
This function colours each object currently in the PyMOL heirarchy<br />
with a different colour. Colours used are either the 22 named<br />
colours used by PyMOL (in which case the 23rd object, if it exists,<br />
gets the same colour as the first), or are the colours of the rainbow<br />
<br />
==List the color of atoms==<br />
To retrieve the color for all residues in a selection, you can iterate over it from the PyMOL command line<br />
<source lang="python"><br />
iterate all, print color<br />
</source><br />
In Python, it looks like this:<br />
<source lang="python"><br />
import pymol<br />
pymol.color_list = []<br />
cmd.iterate('all', 'pymol.color_list.append(color)')<br />
print pymol.color_list<br />
</source><br />
<br />
== See also ==<br />
* [[Ramp_New]]<br />
* [[Get Color Indices]]<br />
<br />
[[Category:Publication_Quality|Advanced Coloring]]<br />
[[Category:Coloring|Advanced Coloring]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12308Get Color Indices2016-03-02T21:19:15Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices. The Pymol names can be used to designate color for objects, see [[Color]].<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
Tangentially related is the fact you can name additional colors,<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
See [[Set Color]] for more details and examples.<br />
<br />
== See Also ==<br />
* [[Get_Color_Tuples]]<br />
* [[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Tuples&diff=12307Get Color Tuples2016-03-02T21:15:41Z<p>Wayne461: redirect to where described since was in see also of Get color indices</p>
<hr />
<div>#REDIRECT [[Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Color&diff=12306Color2016-03-02T21:13:17Z<p>Wayne461: /* SEE ALSO */</p>
<hr />
<div>'''color''' sets the color of an object or an atom selection to a predefined, named color. For an overview of predifined colors, see [[Color Values]]. For a script that enumerates all the colors see, [[List_Colors]]. If you want to define your own colors, see [[Set_Color]].<br />
===USAGE===<br />
<source lang="python"><br />
color color-name<br />
color color-name, object-name<br />
color color-name, (selection)<br />
</source><br />
<br />
===PYMOL API===<br />
<source lang="python">cmd.color( string color, string selection )</source><br />
<br />
==EXAMPLES==<br />
===Color all carbons yellow===<br />
<source lang="python">color yellow, (name C*)</source><br />
<br />
===Color by Spectrum Example===<br />
Color by spectrum is in the GUI menu but did you realize that the spectrum is not limited to a simple rainbow?<br />
<source lang="python"><br />
spectrum count, palette, object_name<br />
</source><br />
<br />
For available palettes and more details see: [[spectrum]]<br />
<br />
===B-Factors===<br />
The command to color a molecule by B-Factors (B Factors) is:<br />
<source lang="python"><br />
spectrum b, selection=SEL<br />
</source><br />
where '''SEL''' is a valid selection, for example, "protA and n. CA", for protein A's alpha carbons.<br />
<br />
For more details see: [[spectrum]]<br />
<br />
====Reassigning B-Factors and Coloring====<br />
It is commonplace to replace the B-Factor column of a protein with some other biochemical property at that residue, observed from some calculation or experiment. PyMOL can easily reassign the B-Factors and color them, too. The following example will load a protein, set ALL it's B Factors to "0", read in a list of properties for each alpha carbon in the proteins, assign those new values as the B-Factor values and color by the new values. This example is possible because commands PyMOL does not recognize are passed to the Python interpreter --- a very powerful tool.<br />
<source lang="python"><br />
# load the protein<br />
cmd.load("protA.pdb")<br />
<br />
# open the file of new values (just 1 column of numbers, one for each alpha carbon)<br />
inFile = open("newBFactors", 'r')<br />
<br />
# create the global, stored array<br />
stored.newB = []<br />
<br />
# read the new B factors from file<br />
for line in inFile.readlines(): stored.newB.append( float(line) )<br />
<br />
# close the input file<br />
inFile.close()<br />
<br />
# clear out the old B Factors<br />
alter protA, b=0.0<br />
<br />
# update the B Factors with new properties<br />
alter protA and n. CA, b=stored.newB.pop(0)<br />
<br />
# color the protein based on the new B Factors of the alpha carbons<br />
cmd.spectrum("b", "protA and n. CA")<br />
</source><br />
<br />
If you want to save the file with the new B Factor values for each alpha carbon,<br />
<source lang="python"><br />
cmd.save("protA_newBFactors.pdb", "protA")<br />
</source><br />
or similar is all you need.<br />
<br />
A script (data2bfactor.py) that loads data into the B-factor (b) or occupancy (q) columns from an external file can be found in Robert Campbell's PyMOL script repository (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)<br />
<br />
====Reassigning B-Factors and Coloring - from file ====<br />
<source lang="python"><br />
reinitialize<br />
prot="1XYZ"<br />
cmd.fetch(prot,async=0)<br />
<br />
# Set b value to zero<br />
cmd.alter(prot,b=0.0)<br />
cmd.show_as("cartoon",prot)<br />
<br />
python<br />
inFile = open("phi_values.txt", 'r')<br />
val_list = []<br />
for line in inFile.readlines()[1:]:<br />
split = line.split()<br />
resn = split[0][0] <br />
resi = split[0][1:-1]<br />
phi_ppm2 = float(split[1])<br />
phi_ppm2_err = float(split[3])<br />
R2_0 = float(split[4])<br />
R2_0_err = float(split[6])<br />
print "Resn=%s Resi=%s, phi_ppm2=%2.2f, phi_ppm2_err=%2.2f, R2_0=%2.2f, R2_0_err=%2.2f"%(resn,resi,phi_ppm2,phi_ppm2_err,R2_0,R2_0_err)<br />
<br />
val_list.append(phi_ppm2)<br />
cmd.alter("%s and resi %s and n. CA"%(prot,resi), "b=%s"%phi_ppm2)<br />
<br />
python end<br />
minval = min(val_list)<br />
print minval<br />
maxval = max(val_list)<br />
print maxval<br />
cmd.spectrum("b", "blue_white_red", "%s and n. CA"%prot, minimum=0, maximum=maxval)<br />
cmd.ramp_new("ramp_obj", prot, range=[0, minval, maxval], color="[blue, white, red ]")<br />
cmd.save("%s_newBFactors.pdb"%prot, "%s"%prot)<br />
</source><br />
<br />
=== Expanding to Surface ===<br />
See [[Expand_To_Surface]].<br />
<br />
If you have run the above code and would like the colors to be shown in the [[Surface]] representation, too, then you need to do the following:<br />
<source lang="python"><br />
# Assumes alpha carbons colored from above.<br />
create ca_obj, your-object-name and name ca <br />
ramp_new ramp_obj, ca_obj, [0, 10], [-1, -1, 0]<br />
set surface_color, ramp_obj, your-object-name<br />
</source><br />
<br />
Thanks to Warren, for this one.<br />
<br />
=== Getting Atom Colors ===<br />
<source lang="python"><br />
stored.list = []<br />
iterate all, stored.list.append(color) # use cmd.get_color_tuple(color) to convert color index to RGB values<br />
print stored.list<br />
</source><br />
<br />
Or, you can [[label]] each atom by it's color code:<br />
<source lang="python"><br />
label all, color<br />
</source><br />
<br />
=== What colors does PyMOL currently have? ===<br />
basic colors can be manually accessed and edited from the PyMOL menu under '''Setting''' --> '''Colors...'''<br><br />
At the Pymol prompt, you can use the command [[Get Color Indices]] to get a list of Pymols named colors.<br><br />
[[Get_colors]] is a script that allows accessing colors as well.<br><br />
<br />
=== Color States Individually ===<br />
<source lang="python"><br />
fetch 1nmr<br />
set all_states<br />
<br />
# the object has 20 states, so we can set separate line colors<br />
# for each state as follows:<br />
for a in range(1,21): cmd.set("line_color","auto","1nmr",a)<br />
</source><br />
Or, we can do it differently,<br />
<source lang="python"><br />
# start over,<br />
fetch 1nmr<br />
<br />
# break apart the object by state<br />
split_states 1nmr<br />
<br />
# delete the original<br />
dele 1nmr<br />
<br />
# and color by object (carbons only)<br />
util.color_objs("elem c")<br />
<br />
# (all atoms)<br />
util.color_objs("all")<br />
</source><br />
<br />
== SEE ALSO ==<br />
<br />
* [[Advanced Coloring]]<br />
* [[Get Color Indices]]<br />
* [[spectrum]]<br />
* [[Ramp_New]]<br />
<br />
[[Category:Objects_and_Selections|Color]]<br />
[[Category:Commands|Color]]<br />
[[Category:States|Coloring states individually]]<br />
[[Category:Coloring|Color]]</div>Wayne461https://pymolwiki.org/index.php?title=Color&diff=12305Color2016-03-02T21:12:26Z<p>Wayne461: /* What colors does PyMOL currently have? */</p>
<hr />
<div>'''color''' sets the color of an object or an atom selection to a predefined, named color. For an overview of predifined colors, see [[Color Values]]. For a script that enumerates all the colors see, [[List_Colors]]. If you want to define your own colors, see [[Set_Color]].<br />
===USAGE===<br />
<source lang="python"><br />
color color-name<br />
color color-name, object-name<br />
color color-name, (selection)<br />
</source><br />
<br />
===PYMOL API===<br />
<source lang="python">cmd.color( string color, string selection )</source><br />
<br />
==EXAMPLES==<br />
===Color all carbons yellow===<br />
<source lang="python">color yellow, (name C*)</source><br />
<br />
===Color by Spectrum Example===<br />
Color by spectrum is in the GUI menu but did you realize that the spectrum is not limited to a simple rainbow?<br />
<source lang="python"><br />
spectrum count, palette, object_name<br />
</source><br />
<br />
For available palettes and more details see: [[spectrum]]<br />
<br />
===B-Factors===<br />
The command to color a molecule by B-Factors (B Factors) is:<br />
<source lang="python"><br />
spectrum b, selection=SEL<br />
</source><br />
where '''SEL''' is a valid selection, for example, "protA and n. CA", for protein A's alpha carbons.<br />
<br />
For more details see: [[spectrum]]<br />
<br />
====Reassigning B-Factors and Coloring====<br />
It is commonplace to replace the B-Factor column of a protein with some other biochemical property at that residue, observed from some calculation or experiment. PyMOL can easily reassign the B-Factors and color them, too. The following example will load a protein, set ALL it's B Factors to "0", read in a list of properties for each alpha carbon in the proteins, assign those new values as the B-Factor values and color by the new values. This example is possible because commands PyMOL does not recognize are passed to the Python interpreter --- a very powerful tool.<br />
<source lang="python"><br />
# load the protein<br />
cmd.load("protA.pdb")<br />
<br />
# open the file of new values (just 1 column of numbers, one for each alpha carbon)<br />
inFile = open("newBFactors", 'r')<br />
<br />
# create the global, stored array<br />
stored.newB = []<br />
<br />
# read the new B factors from file<br />
for line in inFile.readlines(): stored.newB.append( float(line) )<br />
<br />
# close the input file<br />
inFile.close()<br />
<br />
# clear out the old B Factors<br />
alter protA, b=0.0<br />
<br />
# update the B Factors with new properties<br />
alter protA and n. CA, b=stored.newB.pop(0)<br />
<br />
# color the protein based on the new B Factors of the alpha carbons<br />
cmd.spectrum("b", "protA and n. CA")<br />
</source><br />
<br />
If you want to save the file with the new B Factor values for each alpha carbon,<br />
<source lang="python"><br />
cmd.save("protA_newBFactors.pdb", "protA")<br />
</source><br />
or similar is all you need.<br />
<br />
A script (data2bfactor.py) that loads data into the B-factor (b) or occupancy (q) columns from an external file can be found in Robert Campbell's PyMOL script repository (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)<br />
<br />
====Reassigning B-Factors and Coloring - from file ====<br />
<source lang="python"><br />
reinitialize<br />
prot="1XYZ"<br />
cmd.fetch(prot,async=0)<br />
<br />
# Set b value to zero<br />
cmd.alter(prot,b=0.0)<br />
cmd.show_as("cartoon",prot)<br />
<br />
python<br />
inFile = open("phi_values.txt", 'r')<br />
val_list = []<br />
for line in inFile.readlines()[1:]:<br />
split = line.split()<br />
resn = split[0][0] <br />
resi = split[0][1:-1]<br />
phi_ppm2 = float(split[1])<br />
phi_ppm2_err = float(split[3])<br />
R2_0 = float(split[4])<br />
R2_0_err = float(split[6])<br />
print "Resn=%s Resi=%s, phi_ppm2=%2.2f, phi_ppm2_err=%2.2f, R2_0=%2.2f, R2_0_err=%2.2f"%(resn,resi,phi_ppm2,phi_ppm2_err,R2_0,R2_0_err)<br />
<br />
val_list.append(phi_ppm2)<br />
cmd.alter("%s and resi %s and n. CA"%(prot,resi), "b=%s"%phi_ppm2)<br />
<br />
python end<br />
minval = min(val_list)<br />
print minval<br />
maxval = max(val_list)<br />
print maxval<br />
cmd.spectrum("b", "blue_white_red", "%s and n. CA"%prot, minimum=0, maximum=maxval)<br />
cmd.ramp_new("ramp_obj", prot, range=[0, minval, maxval], color="[blue, white, red ]")<br />
cmd.save("%s_newBFactors.pdb"%prot, "%s"%prot)<br />
</source><br />
<br />
=== Expanding to Surface ===<br />
See [[Expand_To_Surface]].<br />
<br />
If you have run the above code and would like the colors to be shown in the [[Surface]] representation, too, then you need to do the following:<br />
<source lang="python"><br />
# Assumes alpha carbons colored from above.<br />
create ca_obj, your-object-name and name ca <br />
ramp_new ramp_obj, ca_obj, [0, 10], [-1, -1, 0]<br />
set surface_color, ramp_obj, your-object-name<br />
</source><br />
<br />
Thanks to Warren, for this one.<br />
<br />
=== Getting Atom Colors ===<br />
<source lang="python"><br />
stored.list = []<br />
iterate all, stored.list.append(color) # use cmd.get_color_tuple(color) to convert color index to RGB values<br />
print stored.list<br />
</source><br />
<br />
Or, you can [[label]] each atom by it's color code:<br />
<source lang="python"><br />
label all, color<br />
</source><br />
<br />
=== What colors does PyMOL currently have? ===<br />
basic colors can be manually accessed and edited from the PyMOL menu under '''Setting''' --> '''Colors...'''<br><br />
At the Pymol prompt, you can use the command [[Get Color Indices]] to get a list of Pymols named colors.<br><br />
[[Get_colors]] is a script that allows accessing colors as well.<br><br />
<br />
=== Color States Individually ===<br />
<source lang="python"><br />
fetch 1nmr<br />
set all_states<br />
<br />
# the object has 20 states, so we can set separate line colors<br />
# for each state as follows:<br />
for a in range(1,21): cmd.set("line_color","auto","1nmr",a)<br />
</source><br />
Or, we can do it differently,<br />
<source lang="python"><br />
# start over,<br />
fetch 1nmr<br />
<br />
# break apart the object by state<br />
split_states 1nmr<br />
<br />
# delete the original<br />
dele 1nmr<br />
<br />
# and color by object (carbons only)<br />
util.color_objs("elem c")<br />
<br />
# (all atoms)<br />
util.color_objs("all")<br />
</source><br />
<br />
== SEE ALSO ==<br />
<br />
* [[Advanced Coloring]]<br />
* [[spectrum]]<br />
* [[Ramp_New]]<br />
<br />
[[Category:Objects_and_Selections|Color]]<br />
[[Category:Commands|Color]]<br />
[[Category:States|Coloring states individually]]<br />
[[Category:Coloring|Color]]</div>Wayne461https://pymolwiki.org/index.php?title=Color&diff=12304Color2016-03-02T21:11:21Z<p>Wayne461: /* What colors does PyMOL currently have? */</p>
<hr />
<div>'''color''' sets the color of an object or an atom selection to a predefined, named color. For an overview of predifined colors, see [[Color Values]]. For a script that enumerates all the colors see, [[List_Colors]]. If you want to define your own colors, see [[Set_Color]].<br />
===USAGE===<br />
<source lang="python"><br />
color color-name<br />
color color-name, object-name<br />
color color-name, (selection)<br />
</source><br />
<br />
===PYMOL API===<br />
<source lang="python">cmd.color( string color, string selection )</source><br />
<br />
==EXAMPLES==<br />
===Color all carbons yellow===<br />
<source lang="python">color yellow, (name C*)</source><br />
<br />
===Color by Spectrum Example===<br />
Color by spectrum is in the GUI menu but did you realize that the spectrum is not limited to a simple rainbow?<br />
<source lang="python"><br />
spectrum count, palette, object_name<br />
</source><br />
<br />
For available palettes and more details see: [[spectrum]]<br />
<br />
===B-Factors===<br />
The command to color a molecule by B-Factors (B Factors) is:<br />
<source lang="python"><br />
spectrum b, selection=SEL<br />
</source><br />
where '''SEL''' is a valid selection, for example, "protA and n. CA", for protein A's alpha carbons.<br />
<br />
For more details see: [[spectrum]]<br />
<br />
====Reassigning B-Factors and Coloring====<br />
It is commonplace to replace the B-Factor column of a protein with some other biochemical property at that residue, observed from some calculation or experiment. PyMOL can easily reassign the B-Factors and color them, too. The following example will load a protein, set ALL it's B Factors to "0", read in a list of properties for each alpha carbon in the proteins, assign those new values as the B-Factor values and color by the new values. This example is possible because commands PyMOL does not recognize are passed to the Python interpreter --- a very powerful tool.<br />
<source lang="python"><br />
# load the protein<br />
cmd.load("protA.pdb")<br />
<br />
# open the file of new values (just 1 column of numbers, one for each alpha carbon)<br />
inFile = open("newBFactors", 'r')<br />
<br />
# create the global, stored array<br />
stored.newB = []<br />
<br />
# read the new B factors from file<br />
for line in inFile.readlines(): stored.newB.append( float(line) )<br />
<br />
# close the input file<br />
inFile.close()<br />
<br />
# clear out the old B Factors<br />
alter protA, b=0.0<br />
<br />
# update the B Factors with new properties<br />
alter protA and n. CA, b=stored.newB.pop(0)<br />
<br />
# color the protein based on the new B Factors of the alpha carbons<br />
cmd.spectrum("b", "protA and n. CA")<br />
</source><br />
<br />
If you want to save the file with the new B Factor values for each alpha carbon,<br />
<source lang="python"><br />
cmd.save("protA_newBFactors.pdb", "protA")<br />
</source><br />
or similar is all you need.<br />
<br />
A script (data2bfactor.py) that loads data into the B-factor (b) or occupancy (q) columns from an external file can be found in Robert Campbell's PyMOL script repository (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)<br />
<br />
====Reassigning B-Factors and Coloring - from file ====<br />
<source lang="python"><br />
reinitialize<br />
prot="1XYZ"<br />
cmd.fetch(prot,async=0)<br />
<br />
# Set b value to zero<br />
cmd.alter(prot,b=0.0)<br />
cmd.show_as("cartoon",prot)<br />
<br />
python<br />
inFile = open("phi_values.txt", 'r')<br />
val_list = []<br />
for line in inFile.readlines()[1:]:<br />
split = line.split()<br />
resn = split[0][0] <br />
resi = split[0][1:-1]<br />
phi_ppm2 = float(split[1])<br />
phi_ppm2_err = float(split[3])<br />
R2_0 = float(split[4])<br />
R2_0_err = float(split[6])<br />
print "Resn=%s Resi=%s, phi_ppm2=%2.2f, phi_ppm2_err=%2.2f, R2_0=%2.2f, R2_0_err=%2.2f"%(resn,resi,phi_ppm2,phi_ppm2_err,R2_0,R2_0_err)<br />
<br />
val_list.append(phi_ppm2)<br />
cmd.alter("%s and resi %s and n. CA"%(prot,resi), "b=%s"%phi_ppm2)<br />
<br />
python end<br />
minval = min(val_list)<br />
print minval<br />
maxval = max(val_list)<br />
print maxval<br />
cmd.spectrum("b", "blue_white_red", "%s and n. CA"%prot, minimum=0, maximum=maxval)<br />
cmd.ramp_new("ramp_obj", prot, range=[0, minval, maxval], color="[blue, white, red ]")<br />
cmd.save("%s_newBFactors.pdb"%prot, "%s"%prot)<br />
</source><br />
<br />
=== Expanding to Surface ===<br />
See [[Expand_To_Surface]].<br />
<br />
If you have run the above code and would like the colors to be shown in the [[Surface]] representation, too, then you need to do the following:<br />
<source lang="python"><br />
# Assumes alpha carbons colored from above.<br />
create ca_obj, your-object-name and name ca <br />
ramp_new ramp_obj, ca_obj, [0, 10], [-1, -1, 0]<br />
set surface_color, ramp_obj, your-object-name<br />
</source><br />
<br />
Thanks to Warren, for this one.<br />
<br />
=== Getting Atom Colors ===<br />
<source lang="python"><br />
stored.list = []<br />
iterate all, stored.list.append(color) # use cmd.get_color_tuple(color) to convert color index to RGB values<br />
print stored.list<br />
</source><br />
<br />
Or, you can [[label]] each atom by it's color code:<br />
<source lang="python"><br />
label all, color<br />
</source><br />
<br />
=== What colors does PyMOL currently have? ===<br />
basic colors can be manually accessed and edited from the PyMOL menu under '''Setting''' --> '''Colors...'''<br><br />
You can use the [[Get Color Indices]] to get a list of Pymols named colors.<br><br />
[[Get_colors]] is a script that allows accessing colors as well.<br><br />
<br />
=== Color States Individually ===<br />
<source lang="python"><br />
fetch 1nmr<br />
set all_states<br />
<br />
# the object has 20 states, so we can set separate line colors<br />
# for each state as follows:<br />
for a in range(1,21): cmd.set("line_color","auto","1nmr",a)<br />
</source><br />
Or, we can do it differently,<br />
<source lang="python"><br />
# start over,<br />
fetch 1nmr<br />
<br />
# break apart the object by state<br />
split_states 1nmr<br />
<br />
# delete the original<br />
dele 1nmr<br />
<br />
# and color by object (carbons only)<br />
util.color_objs("elem c")<br />
<br />
# (all atoms)<br />
util.color_objs("all")<br />
</source><br />
<br />
== SEE ALSO ==<br />
<br />
* [[Advanced Coloring]]<br />
* [[spectrum]]<br />
* [[Ramp_New]]<br />
<br />
[[Category:Objects_and_Selections|Color]]<br />
[[Category:Commands|Color]]<br />
[[Category:States|Coloring states individually]]<br />
[[Category:Coloring|Color]]</div>Wayne461https://pymolwiki.org/index.php?title=Color&diff=12303Color2016-03-02T21:09:38Z<p>Wayne461: /* What colors does PyMOL currently have? */</p>
<hr />
<div>'''color''' sets the color of an object or an atom selection to a predefined, named color. For an overview of predifined colors, see [[Color Values]]. For a script that enumerates all the colors see, [[List_Colors]]. If you want to define your own colors, see [[Set_Color]].<br />
===USAGE===<br />
<source lang="python"><br />
color color-name<br />
color color-name, object-name<br />
color color-name, (selection)<br />
</source><br />
<br />
===PYMOL API===<br />
<source lang="python">cmd.color( string color, string selection )</source><br />
<br />
==EXAMPLES==<br />
===Color all carbons yellow===<br />
<source lang="python">color yellow, (name C*)</source><br />
<br />
===Color by Spectrum Example===<br />
Color by spectrum is in the GUI menu but did you realize that the spectrum is not limited to a simple rainbow?<br />
<source lang="python"><br />
spectrum count, palette, object_name<br />
</source><br />
<br />
For available palettes and more details see: [[spectrum]]<br />
<br />
===B-Factors===<br />
The command to color a molecule by B-Factors (B Factors) is:<br />
<source lang="python"><br />
spectrum b, selection=SEL<br />
</source><br />
where '''SEL''' is a valid selection, for example, "protA and n. CA", for protein A's alpha carbons.<br />
<br />
For more details see: [[spectrum]]<br />
<br />
====Reassigning B-Factors and Coloring====<br />
It is commonplace to replace the B-Factor column of a protein with some other biochemical property at that residue, observed from some calculation or experiment. PyMOL can easily reassign the B-Factors and color them, too. The following example will load a protein, set ALL it's B Factors to "0", read in a list of properties for each alpha carbon in the proteins, assign those new values as the B-Factor values and color by the new values. This example is possible because commands PyMOL does not recognize are passed to the Python interpreter --- a very powerful tool.<br />
<source lang="python"><br />
# load the protein<br />
cmd.load("protA.pdb")<br />
<br />
# open the file of new values (just 1 column of numbers, one for each alpha carbon)<br />
inFile = open("newBFactors", 'r')<br />
<br />
# create the global, stored array<br />
stored.newB = []<br />
<br />
# read the new B factors from file<br />
for line in inFile.readlines(): stored.newB.append( float(line) )<br />
<br />
# close the input file<br />
inFile.close()<br />
<br />
# clear out the old B Factors<br />
alter protA, b=0.0<br />
<br />
# update the B Factors with new properties<br />
alter protA and n. CA, b=stored.newB.pop(0)<br />
<br />
# color the protein based on the new B Factors of the alpha carbons<br />
cmd.spectrum("b", "protA and n. CA")<br />
</source><br />
<br />
If you want to save the file with the new B Factor values for each alpha carbon,<br />
<source lang="python"><br />
cmd.save("protA_newBFactors.pdb", "protA")<br />
</source><br />
or similar is all you need.<br />
<br />
A script (data2bfactor.py) that loads data into the B-factor (b) or occupancy (q) columns from an external file can be found in Robert Campbell's PyMOL script repository (http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/)<br />
<br />
====Reassigning B-Factors and Coloring - from file ====<br />
<source lang="python"><br />
reinitialize<br />
prot="1XYZ"<br />
cmd.fetch(prot,async=0)<br />
<br />
# Set b value to zero<br />
cmd.alter(prot,b=0.0)<br />
cmd.show_as("cartoon",prot)<br />
<br />
python<br />
inFile = open("phi_values.txt", 'r')<br />
val_list = []<br />
for line in inFile.readlines()[1:]:<br />
split = line.split()<br />
resn = split[0][0] <br />
resi = split[0][1:-1]<br />
phi_ppm2 = float(split[1])<br />
phi_ppm2_err = float(split[3])<br />
R2_0 = float(split[4])<br />
R2_0_err = float(split[6])<br />
print "Resn=%s Resi=%s, phi_ppm2=%2.2f, phi_ppm2_err=%2.2f, R2_0=%2.2f, R2_0_err=%2.2f"%(resn,resi,phi_ppm2,phi_ppm2_err,R2_0,R2_0_err)<br />
<br />
val_list.append(phi_ppm2)<br />
cmd.alter("%s and resi %s and n. CA"%(prot,resi), "b=%s"%phi_ppm2)<br />
<br />
python end<br />
minval = min(val_list)<br />
print minval<br />
maxval = max(val_list)<br />
print maxval<br />
cmd.spectrum("b", "blue_white_red", "%s and n. CA"%prot, minimum=0, maximum=maxval)<br />
cmd.ramp_new("ramp_obj", prot, range=[0, minval, maxval], color="[blue, white, red ]")<br />
cmd.save("%s_newBFactors.pdb"%prot, "%s"%prot)<br />
</source><br />
<br />
=== Expanding to Surface ===<br />
See [[Expand_To_Surface]].<br />
<br />
If you have run the above code and would like the colors to be shown in the [[Surface]] representation, too, then you need to do the following:<br />
<source lang="python"><br />
# Assumes alpha carbons colored from above.<br />
create ca_obj, your-object-name and name ca <br />
ramp_new ramp_obj, ca_obj, [0, 10], [-1, -1, 0]<br />
set surface_color, ramp_obj, your-object-name<br />
</source><br />
<br />
Thanks to Warren, for this one.<br />
<br />
=== Getting Atom Colors ===<br />
<source lang="python"><br />
stored.list = []<br />
iterate all, stored.list.append(color) # use cmd.get_color_tuple(color) to convert color index to RGB values<br />
print stored.list<br />
</source><br />
<br />
Or, you can [[label]] each atom by it's color code:<br />
<source lang="python"><br />
label all, color<br />
</source><br />
<br />
=== What colors does PyMOL currently have? ===<br />
basic colors can be manually accessed and edited from the PyMOL menu under '''Setting''' --> '''Colors...'''<br><br />
[[Get_colors]] is a script that allows accessing colors<br />
You can use the [[Get Color Indices]] to get a list of Pymols named colors.<br />
<br />
=== Color States Individually ===<br />
<source lang="python"><br />
fetch 1nmr<br />
set all_states<br />
<br />
# the object has 20 states, so we can set separate line colors<br />
# for each state as follows:<br />
for a in range(1,21): cmd.set("line_color","auto","1nmr",a)<br />
</source><br />
Or, we can do it differently,<br />
<source lang="python"><br />
# start over,<br />
fetch 1nmr<br />
<br />
# break apart the object by state<br />
split_states 1nmr<br />
<br />
# delete the original<br />
dele 1nmr<br />
<br />
# and color by object (carbons only)<br />
util.color_objs("elem c")<br />
<br />
# (all atoms)<br />
util.color_objs("all")<br />
</source><br />
<br />
== SEE ALSO ==<br />
<br />
* [[Advanced Coloring]]<br />
* [[spectrum]]<br />
* [[Ramp_New]]<br />
<br />
[[Category:Objects_and_Selections|Color]]<br />
[[Category:Commands|Color]]<br />
[[Category:States|Coloring states individually]]<br />
[[Category:Coloring|Color]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12302Get Color Indices2016-03-02T21:06:48Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
Tangentially related,<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
* [[Get_Color_Tuples]]<br />
* [[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12301Get Color Indices2016-03-02T21:05:17Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
Tangentially related,<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12300Get Color Indices2016-03-02T21:04:22Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while employing [[Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12299Get Color Indices2016-03-02T21:03:45Z<p>Wayne461: </p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while [[iterating|Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12298Get Color Indices2016-03-02T21:03:18Z<p>Wayne461: fixing typo</p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the Pymol color names and corresponding internal color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when ''index-number'' is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while [[iterating|Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12297Get Color Indices2016-03-02T20:59:00Z<p>Wayne461: fixes lines</p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the color names and corresponding color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source><br />
<br />
will retrieve individual RGB components when `index-number` is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while [[iterating|Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12296Get Color Indices2016-03-02T20:57:49Z<p>Wayne461: trying to fix typos and adding how relates to iterate function.</p>
<hr />
<div>'''get_color_indices''' in combination with '''get_color_tuple''' will retrieve the RGB values for colors.<br />
<br />
<source lang="python"><br />
print cmd.get_color_indices()<br />
</source><br />
will retrieve the color names and corresponding color indices.<br />
<br />
<source lang="python">print cmd.get_color_tuple(index-number)</source> will retrieve individual RGB components when `index-number` is replaced with one of the color indices from above.<br />
<br />
The color index, an integer, gets returned when color is returned while [[iterating|Iterate]]. You can thus use the '''get_color_tuple''' command above to convert that to RGB color values if you need to use the colors outside Pymol.<br />
<br />
<source lang="python"><br />
set_color color-name, [r,b,g]<br />
</source><br />
<br />
will create a new color that will appear in the GUI list. From the<br />
open-source GUI you can use the "add" button in the color list viewer.<br />
In MacPyMOL, enter the new name into the MacPyMOL color editor window,<br />
set the RGBs, and then click Apply.<br />
<br />
== See Also ==<br />
[[Get_Color_Tuples]]<br />
[[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Wayne461https://pymolwiki.org/index.php?title=Gallery&diff=9216Gallery2011-08-03T19:14:23Z<p>Wayne461: </p>
<hr />
<div>{| align="center"<br />
|+ style="font-size:190%; font-weight: bold; color:#038; padding-bottom: 15px;" |PyMOLWiki Gallery<br />
|- style="text-align:center; font-weight: bold; font-size:120%; color:#333;"<br />
| Cool PyMOL-generated Images and their Scripts.<br/><br/>''[[Talk:Gallery#Adding|Add Your Own]]''<br />
|-<br />
|}<br />
<br />
<br />
<br />
{{GalleryImage<br />
<!-- This creates a row entry for the Gallery section --><br />
|<!-- Image --><br />
image=BW_raytraced_complex_image.jpg|size=200px<br />
|<!-- Title above image --><br />
title=Complex B&W outline representation<br />
|<!-- 'Description' section (shows up below image)--><br />
description=Making a B&W outlined image with depth.<br />
|<!-- 'What to Type' section --><br />
cmdString=<source lang="python"><br />
# first load lipid model<br />
load lipids.pdb; <br />
# hide the initially loaded representation<br />
hide all; <br />
# set background color to white<br />
bg_color white; <br />
# show lipid model as sticks<br />
show sticks, lipids; <br />
# color the lipids model by element CHNOS #2 (carbon green)<br />
util.cbag lipids; <br />
<br />
# select all hydrogens and remove them from the model<br />
select hideme, hydro; <br />
hide everything, hideme; <br />
delete hideme;<br />
<br />
# create phosphate spheres<br />
create phos, elem p; <br />
hide everything, phos;<br />
show spheres, phos;<br />
<br />
# load helix model<br />
load helix.pdb; <br />
# hide the initially loaded representation<br />
hide everything, helix;<br />
# make the helical struct into a cartoon form<br />
show cartoon, helix; <br />
# style the cartoon form<br />
cartoon putty; <br />
<br />
# reposition the helix among the lipids using<br />
# the 3-Button Editing Mouse Mode<br />
# basically<br />
# Shift+Left Mouse to rotate the helix<br />
# Shift+Middle Mouse to move the helix<br />
# also, you may want to make liberal use of the<br />
# get_view and set_view commands.<br />
#<br />
# When you have the scene set like you want,<br />
# continue with...<br />
<br />
# move the model to find the view you want, <br />
# and use get_view to get the coordinate description<br />
get_view;<br />
<br />
# set ray_trace_mode to black and white outline<br />
set ray_trace_mode, 2;<br />
</source><br />
Now, you'll need to save multiple versions of your model. (use '''ray''', then '''png''' ''<filename>'' to save each version)<ol><br />
<li> Version A: with all the elements except for the helix. This will become the background.</li><br />
<li> Version B: with the 'front' elements, and the helix. Basically this is just a few 'layers' of lipid, with the helix among them. To do this:</li><ol type="a"><br />
<li>move the model around until you visually see the part to remove</li><br />
<li>switch your Mouse Mode to 3-button viewing, then use the +Box selection (Shift+Left mouse) to select the 'background' portion to hide.</li><br />
<li>choose Hide>Everything for the selection</li><br />
<li>use the code from get_view to go back to the original view</li><br />
</ol></ol><br />
Finally, you will need to compose the image in Photoshop (or Gimp, here I'll use Photoshop).<ol><br />
<li>Load the two versions.</li><br />
<li>Select the white background in Version B, then choose Select>Color Range...</li><br />
<li>Make sure 'Select' is set to 'Sampled Colors', and 'Fuzziness' is set to 150, then click okay.</li><br />
<li>delete the white selection, then choose Select>All</li><br />
<li>copy the picture, then switch to Version A and paste the selection (it should paste into its own layer as 'Layer 1')</li><br />
<li>Click on 'Layer 0' (which is Version A) and change its opacity to 30%</li><br />
<li>Create a new layer under 'Layer 0' which is filled with white only (or whatever background color you like)</li><br />
<li>Click on 'Layer 1' (which is Version B), and using the Move tool (and nudge), align the molecules in 'Layer 1' to 'Layer 0'</li><br />
<li>Some parts of 'Layer 1' are transparent and shouldn't be. Using the Paint Bucket tool fill in these areas with white (or whichever color you find appropriate).</li><br />
<li>Admire your handiwork; put it in a publication, presentation, or poster.</li></ol><br />
|<!-- 'See Also' section (shows up below image)--><br />
seeAlso=<br />
* [[Bg_Color|bg_color]]<br />
* [[Get_View|get_view]]<br />
* Mouse Modes (no good reference for this?)<br />
* [[png]]<br />
* [[Cartoon#Sausage_Representation|putty]]<br />
* [[ray]]<br />
* [[Ray#Modes|ray_trace_mode]]<br />
* [[set]]<br />
* [[Set_View|set_view]]<br />
* [[Single-word_Selectors |single word property selectors]]<br />
* [[Advanced_Coloring#Coloring_by_atom_type|util.cbag]]<br />
}}<br />
<br />
<br />
<br />
{{GalleryImage<br />
|image=Image_merged.png|size=200px|title=A "Sliced" Image|description=A more complex example of how to create an image of a slice.<br />
|cmdString=<source lang="python"><br />
# example script for creation of an image with a slice region<br />
load $PYMOL_PATH/test/dat/1tii.pdb<br />
orient<br />
<br />
# must disable depth cue and shadows<br />
unset depth_cue<br />
unset ray_shadows<br />
set ray_trace_mode, 0<br />
<br />
# this controls the z depth of the slice plane<br />
# (sets it halfway between the clipping planes)<br />
fraction = 0.42<br />
view = cmd.get_view()<br />
near_dist = fraction*(view[16]-view[15])<br />
far_dist = (view[16]-view[15]) - near_dist<br />
cmd.clip("near", -near_dist)<br />
<br />
# render opaque background image<br />
as surface<br />
set ray_interior_color, grey80<br />
set opaque_background<br />
set surface_color, white<br />
ray<br />
save image_back.png<br />
<br />
cmd.clip("near", near_dist)<br />
cmd.clip("far", far_dist)<br />
<br />
# render the foreground image<br />
as cartoon<br />
util.cbc<br />
unset opaque_background<br />
ray<br />
save image_front.png<br />
<br />
# now use Photoshop, Gimp, or ImageMagick to combine the images<br />
system composite image_front.png image_back.png image_merged.png<br />
system display image_merged.png<br />
</source><br />
|seeAlso=<br />
*[[load]]<br />
*[[orient]]<br />
*[[set]]<br />
*[[unset]]<br />
*[[depth_cue]]<br />
*[[ray_shadows]]<br />
*[[Ray#Modes|ray_trace_mode]]<br />
*[[Get_View]]<br />
*[[clip]]<br />
*[[as]]<br />
*[[surface]]<br />
*[[cartoon]]<br />
*[[ray_interior_color]]<br />
*[[color]]<br />
*[[ray]]<br />
*[[save]]<br />
*[[util.cbc]]<br />
*[[opaque_background]]<br />
*[[save]]<br />
*[[system]]<br />
}}<br />
<br />
<br />
{{GalleryImage<br />
|image=Gm2.png|size=200px|title=Grid Mode|description=This image shows [[Grid mode|Grid Mode]] in action.<br />
|cmdString=<source lang="python"><br />
fetch 1cll 1sra 1ggz 5pnt 1rlw 1cdy;<br />
set grid_mode<br />
</source><br />
'''Hint:''' You may wish to execute the 'reset' command on the command line after running the above commands to get full molecules in view of window and centered in a more useable manner.<br />
|seeAlso=<br />
*[[Fetch]]<br />
*[[Set]]<br />
*[[grid_mode]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Fov60.png|size=200px|title=Cool Perspective|description=This image shows a perspective through [[Field_Of_View]].<br />
|cmdString=<source lang="python"><br />
load prot.pdb;<br />
zoom i. 46-49 and n. CA<br />
set field_of_view, 60<br />
ray<br />
</source><br />
|seeAlso=<br />
*[[Load]]<br />
*[[Ray]]<br />
*[[Zoom]]<br />
*[[Set]]<br />
*[[Property_Selectors |Short form Selectors]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Pocket.png|size=200px|title=Representing a binding pocket|description=This image shows a nice way to show binding surfaces<br />
|cmdString=<source lang="python"><br />
load $TUT/1hpv.pdb, tmp<br />
extract lig, organic<br />
extract prot, polymer<br />
delete tmp<br />
<br />
set surface_carve_cutoff, 4.5<br />
set surface_carve_selection, lig<br />
set surface_carve_normal_cutoff, -0.1<br />
<br />
show surface, prot within 8 of lig<br />
set two_sided_lighting<br />
set transparency, 0.5<br />
show sticks, lig<br />
orient lig<br />
<br />
set surface_color, white<br />
set surface_type, 2 # mesh<br />
unset ray_shadows<br />
</source><br />
|seeAlso=<br />
*[[extract]]<br />
*[[delete]]<br />
*[[show]]<br />
*[[set]]<br />
*[[orient]]<br />
*[[surface_carve_cutoff]]<br />
*[[surface_carve_selection]]<br />
*[[surface_carve_normal_cutoff]]<br />
*[[surface_color]]<br />
*[[surface_type]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=QuteMolLike.png|size=400px|title=QuteMol Like|description=QuteMol like image--modern ''feel'' to it. Check out the [[Media:Depthmol.mpeg|movie]].<br />
|cmdString=<source lang="python"><br />
load $TUT/1hpv.pdb<br />
set_color oxygen, [1.0,0.4,0.4]<br />
set_color nitrogen, [0.5,0.5,1.0]<br />
remove solvent<br />
as spheres<br />
util.cbaw<br />
bg white<br />
set light_count,10<br />
set spec_count,1<br />
set shininess, 10<br />
set specular, 0.25<br />
set ambient,0<br />
set direct,0<br />
set reflect,1.5<br />
set ray_shadow_decay_factor, 0.1<br />
set ray_shadow_decay_range, 2<br />
unset depth_cue<br />
# for added coolness<br />
# set field_of_view, 60<br />
ray<br />
</source><br />
|seeAlso=<br />
*[[Load]]<br />
*[[Set_color]]<br />
*[[Remove]]<br />
*[[Solvent]]<br />
*[[As]]<br />
*[[Util]]<br />
*[[Util.cbaw]]<br />
*[[Bg]]<br />
*[[Light_Count]]<br />
*[[Spec_Count]]<br />
*[[Shininess]]<br />
*[[Specular]]<br />
*[[Ambient]]<br />
*[[Direct]]<br />
*[[Reflect]]<br />
*[[Ray_shadow_decay_factor]]<br />
*[[Ray_shadow_decay_range]]<br />
*[[Unset]]<br />
*[[depth_cue]]<br />
*[[Ray]]<br />
*[[Set]]<br />
*[[Property_Selectors |Short form Selectors]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Tilt shift.png|size=500px|title=Simulating Tilt-shift|description=Tilt shift simulation<br />
|cmdString=<source lang="python"><br />
fetch 1wld<br />
as surface, poly<br />
as sticks, org<br />
h_add solvent<br />
color grey, poly<br />
orient org<br />
png img.png<br />
# now, go into Photoshop or the GIMP and apply a Gaussian or<br />
# Focus blur to the top and bottom portions of the image<br />
</source><br />
|seeAlso=<br />
*[[fetch]]<br />
*[[show_as]]<br />
*[[h_add]]<br />
*[[color]]<br />
}}<br />
<br />
<br />
{{GalleryImage<br />
|image=Rnt.png|size=500px|title=Ray-normal-based transparency|description=Ray-normal-based transparency<br />
|cmdString=<source lang="python"><br />
# grey surface<br />
set surface_color, grey<br />
<br />
# cavity mode<br />
set surface_mode, 3<br />
<br />
# layered transparency mode<br />
set transparency_mode, 1<br />
<br />
# surface transparency<br />
set transparency, 0.5<br />
<br />
# oblique and contrast define the<br />
# look of the surface transparency:<br />
# if the normal vector is <br />
set ray_transparency_oblique<br />
set ray_transparency_oblique_power, 8<br />
set ray_transparency_contrast, 7<br />
<br />
# fetch a protein, with a <br />
# small molecule in a nice<br />
# hidden pocket<br />
fetch 1hpv, async=0<br />
<br />
hide<br />
<br />
# show the small molecule as surface<br />
show surface, org<br />
<br />
# arrange the view<br />
orient org<br />
<br />
# zoom back a little<br />
zoom org, 1<br />
<br />
# show the small molecule inside as sticks<br />
show sticks, org<br />
<br />
# show some nearby sidechains<br />
show lines, poly within 5 of org<br />
<br />
# enable frame caching for playback<br />
set cache_frames, 1<br />
<br />
set ray_trace_frames, 1<br />
<br />
mset 1x120<br />
<br />
movie.roll 1, 120, 1, x<br />
<br />
mplay<br />
<br />
# now sit back and wait 5 minutes...<br />
</source><br />
|seeAlso=<br />
* [[surface_color]]<br />
* [[surface_mode]]<br />
* [[transparency_mode]]<br />
* [[transparency]]<br />
* [[ray_transparency_oblique]]<br />
* [[ray_transparency_oblique_power]]<br />
* [[ray_transparency_contrast]]<br />
* [[fetch]]<br />
* [[orient]]<br />
* [[zoom]]<br />
* [[show]]<br />
* [[sticks]]<br />
* [[lines]]<br />
* [[cache_frames]]<br />
* [[mset]]<br />
* [[ray_trace_frames]]<br />
* [[movie.roll]]<br />
}}</div>Wayne461https://pymolwiki.org/index.php?title=Gallery&diff=9215Gallery2011-08-03T19:13:39Z<p>Wayne461: </p>
<hr />
<div>{| align="center"<br />
|+ style="font-size:190%; font-weight: bold; color:#038; padding-bottom: 15px;" |PyMOLWiki Gallery<br />
|- style="text-align:center; font-weight: bold; font-size:120%; color:#333;"<br />
| Cool PyMOL-generated Images and their Scripts.<br/><br/>''[[Talk:Gallery#Adding|Add Your Own]]''<br />
|-<br />
|}<br />
<br />
<br />
<br />
{{GalleryImage<br />
<!-- This creates a row entry for the Gallery section --><br />
|<!-- Image --><br />
image=BW_raytraced_complex_image.jpg|size=200px<br />
|<!-- Title above image --><br />
title=Complex B&W outline representation<br />
|<!-- 'Description' section (shows up below image)--><br />
description=Making a B&W outlined image with depth.<br />
|<!-- 'What to Type' section --><br />
cmdString=<source lang="python"><br />
# first load lipid model<br />
load lipids.pdb; <br />
# hide the initially loaded representation<br />
hide all; <br />
# set background color to white<br />
bg_color white; <br />
# show lipid model as sticks<br />
show sticks, lipids; <br />
# color the lipids model by element CHNOS #2 (carbon green)<br />
util.cbag lipids; <br />
<br />
# select all hydrogens and remove them from the model<br />
select hideme, hydro; <br />
hide everything, hideme; <br />
delete hideme;<br />
<br />
# create phosphate spheres<br />
create phos, elem p; <br />
hide everything, phos;<br />
show spheres, phos;<br />
<br />
# load helix model<br />
load helix.pdb; <br />
# hide the initially loaded representation<br />
hide everything, helix;<br />
# make the helical struct into a cartoon form<br />
show cartoon, helix; <br />
# style the cartoon form<br />
cartoon putty; <br />
<br />
# reposition the helix among the lipids using<br />
# the 3-Button Editing Mouse Mode<br />
# basically<br />
# Shift+Left Mouse to rotate the helix<br />
# Shift+Middle Mouse to move the helix<br />
# also, you may want to make liberal use of the<br />
# get_view and set_view commands.<br />
#<br />
# When you have the scene set like you want,<br />
# continue with...<br />
<br />
# move the model to find the view you want, <br />
# and use get_view to get the coordinate description<br />
get_view;<br />
<br />
# set ray_trace_mode to black and white outline<br />
set ray_trace_mode, 2;<br />
</source><br />
Now, you'll need to save multiple versions of your model. (use '''ray''', then '''png''' ''<filename>'' to save each version)<ol><br />
<li> Version A: with all the elements except for the helix. This will become the background.</li><br />
<li> Version B: with the 'front' elements, and the helix. Basically this is just a few 'layers' of lipid, with the helix among them. To do this:</li><ol type="a"><br />
<li>move the model around until you visually see the part to remove</li><br />
<li>switch your Mouse Mode to 3-button viewing, then use the +Box selection (Shift+Left mouse) to select the 'background' portion to hide.</li><br />
<li>choose Hide>Everything for the selection</li><br />
<li>use the code from get_view to go back to the original view</li><br />
</ol></ol><br />
Finally, you will need to compose the image in Photoshop (or Gimp, here I'll use Photoshop).<ol><br />
<li>Load the two versions.</li><br />
<li>Select the white background in Version B, then choose Select>Color Range...</li><br />
<li>Make sure 'Select' is set to 'Sampled Colors', and 'Fuzziness' is set to 150, then click okay.</li><br />
<li>delete the white selection, then choose Select>All</li><br />
<li>copy the picture, then switch to Version A and paste the selection (it should paste into its own layer as 'Layer 1')</li><br />
<li>Click on 'Layer 0' (which is Version A) and change its opacity to 30%</li><br />
<li>Create a new layer under 'Layer 0' which is filled with white only (or whatever background color you like)</li><br />
<li>Click on 'Layer 1' (which is Version B), and using the Move tool (and nudge), align the molecules in 'Layer 1' to 'Layer 0'</li><br />
<li>Some parts of 'Layer 1' are transparent and shouldn't be. Using the Paint Bucket tool fill in these areas with white (or whichever color you find appropriate).</li><br />
<li>Admire your handiwork; put it in a publication, presentation, or poster.</li></ol><br />
|<!-- 'See Also' section (shows up below image)--><br />
seeAlso=<br />
* [[Bg_Color|bg_color]]<br />
* [[Get_View|get_view]]<br />
* Mouse Modes (no good reference for this?)<br />
* [[png]]<br />
* [[Cartoon#Sausage_Representation|putty]]<br />
* [[ray]]<br />
* [[Ray#Modes|ray_trace_mode]]<br />
* [[set]]<br />
* [[Set_View|set_view]]<br />
* [[Single-word_Selectors |single word property selectors]]<br />
* [[Advanced_Coloring#Coloring_by_atom_type|util.cbag]]<br />
}}<br />
<br />
<br />
<br />
{{GalleryImage<br />
|image=Image_merged.png|size=200px|title=A "Sliced" Image|description=A more complex example of how to create an image of a slice.<br />
|cmdString=<source lang="python"><br />
# example script for creation of an image with a slice region<br />
load $PYMOL_PATH/test/dat/1tii.pdb<br />
orient<br />
<br />
# must disable depth cue and shadows<br />
unset depth_cue<br />
unset ray_shadows<br />
set ray_trace_mode, 0<br />
<br />
# this controls the z depth of the slice plane<br />
# (sets it halfway between the clipping planes)<br />
fraction = 0.42<br />
view = cmd.get_view()<br />
near_dist = fraction*(view[16]-view[15])<br />
far_dist = (view[16]-view[15]) - near_dist<br />
cmd.clip("near", -near_dist)<br />
<br />
# render opaque background image<br />
as surface<br />
set ray_interior_color, grey80<br />
set opaque_background<br />
set surface_color, white<br />
ray<br />
save image_back.png<br />
<br />
cmd.clip("near", near_dist)<br />
cmd.clip("far", far_dist)<br />
<br />
# render the foreground image<br />
as cartoon<br />
util.cbc<br />
unset opaque_background<br />
ray<br />
save image_front.png<br />
<br />
# now use Photoshop, Gimp, or ImageMagick to combine the images<br />
system composite image_front.png image_back.png image_merged.png<br />
system display image_merged.png<br />
</source><br />
|seeAlso=<br />
*[[load]]<br />
*[[orient]]<br />
*[[set]]<br />
*[[unset]]<br />
*[[depth_cue]]<br />
*[[ray_shadows]]<br />
*[[Ray#Modes|ray_trace_mode]]<br />
*[[Get_View]]<br />
*[[clip]]<br />
*[[as]]<br />
*[[surface]]<br />
*[[cartoon]]<br />
*[[ray_interior_color]]<br />
*[[color]]<br />
*[[ray]]<br />
*[[save]]<br />
*[[util.cbc]]<br />
*[[opaque_background]]<br />
*[[save]]<br />
*[[system]]<br />
}}<br />
<br />
<br />
{{GalleryImage<br />
|image=Gm2.png|size=200px|title=Grid Mode|description=This image shows [[Grid mode|Grid Mode]] in action.<br />
|cmdString=<source lang="python"><br />
fetch 1cll 1sra 1ggz 5pnt 1rlw 1cdy;<br />
set grid_mode<br />
</source><br />
'''Hint:''' You may wish to execute the 'reset' command on the command line after running this mode to get full molecules in view of window and centered in a more useable manner.<br />
|seeAlso=<br />
*[[Fetch]]<br />
*[[Set]]<br />
*[[grid_mode]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Fov60.png|size=200px|title=Cool Perspective|description=This image shows a perspective through [[Field_Of_View]].<br />
|cmdString=<source lang="python"><br />
load prot.pdb;<br />
zoom i. 46-49 and n. CA<br />
set field_of_view, 60<br />
ray<br />
</source><br />
|seeAlso=<br />
*[[Load]]<br />
*[[Ray]]<br />
*[[Zoom]]<br />
*[[Set]]<br />
*[[Property_Selectors |Short form Selectors]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Pocket.png|size=200px|title=Representing a binding pocket|description=This image shows a nice way to show binding surfaces<br />
|cmdString=<source lang="python"><br />
load $TUT/1hpv.pdb, tmp<br />
extract lig, organic<br />
extract prot, polymer<br />
delete tmp<br />
<br />
set surface_carve_cutoff, 4.5<br />
set surface_carve_selection, lig<br />
set surface_carve_normal_cutoff, -0.1<br />
<br />
show surface, prot within 8 of lig<br />
set two_sided_lighting<br />
set transparency, 0.5<br />
show sticks, lig<br />
orient lig<br />
<br />
set surface_color, white<br />
set surface_type, 2 # mesh<br />
unset ray_shadows<br />
</source><br />
|seeAlso=<br />
*[[extract]]<br />
*[[delete]]<br />
*[[show]]<br />
*[[set]]<br />
*[[orient]]<br />
*[[surface_carve_cutoff]]<br />
*[[surface_carve_selection]]<br />
*[[surface_carve_normal_cutoff]]<br />
*[[surface_color]]<br />
*[[surface_type]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=QuteMolLike.png|size=400px|title=QuteMol Like|description=QuteMol like image--modern ''feel'' to it. Check out the [[Media:Depthmol.mpeg|movie]].<br />
|cmdString=<source lang="python"><br />
load $TUT/1hpv.pdb<br />
set_color oxygen, [1.0,0.4,0.4]<br />
set_color nitrogen, [0.5,0.5,1.0]<br />
remove solvent<br />
as spheres<br />
util.cbaw<br />
bg white<br />
set light_count,10<br />
set spec_count,1<br />
set shininess, 10<br />
set specular, 0.25<br />
set ambient,0<br />
set direct,0<br />
set reflect,1.5<br />
set ray_shadow_decay_factor, 0.1<br />
set ray_shadow_decay_range, 2<br />
unset depth_cue<br />
# for added coolness<br />
# set field_of_view, 60<br />
ray<br />
</source><br />
|seeAlso=<br />
*[[Load]]<br />
*[[Set_color]]<br />
*[[Remove]]<br />
*[[Solvent]]<br />
*[[As]]<br />
*[[Util]]<br />
*[[Util.cbaw]]<br />
*[[Bg]]<br />
*[[Light_Count]]<br />
*[[Spec_Count]]<br />
*[[Shininess]]<br />
*[[Specular]]<br />
*[[Ambient]]<br />
*[[Direct]]<br />
*[[Reflect]]<br />
*[[Ray_shadow_decay_factor]]<br />
*[[Ray_shadow_decay_range]]<br />
*[[Unset]]<br />
*[[depth_cue]]<br />
*[[Ray]]<br />
*[[Set]]<br />
*[[Property_Selectors |Short form Selectors]]<br />
}}<br />
<br />
{{GalleryImage<br />
|image=Tilt shift.png|size=500px|title=Simulating Tilt-shift|description=Tilt shift simulation<br />
|cmdString=<source lang="python"><br />
fetch 1wld<br />
as surface, poly<br />
as sticks, org<br />
h_add solvent<br />
color grey, poly<br />
orient org<br />
png img.png<br />
# now, go into Photoshop or the GIMP and apply a Gaussian or<br />
# Focus blur to the top and bottom portions of the image<br />
</source><br />
|seeAlso=<br />
*[[fetch]]<br />
*[[show_as]]<br />
*[[h_add]]<br />
*[[color]]<br />
}}<br />
<br />
<br />
{{GalleryImage<br />
|image=Rnt.png|size=500px|title=Ray-normal-based transparency|description=Ray-normal-based transparency<br />
|cmdString=<source lang="python"><br />
# grey surface<br />
set surface_color, grey<br />
<br />
# cavity mode<br />
set surface_mode, 3<br />
<br />
# layered transparency mode<br />
set transparency_mode, 1<br />
<br />
# surface transparency<br />
set transparency, 0.5<br />
<br />
# oblique and contrast define the<br />
# look of the surface transparency:<br />
# if the normal vector is <br />
set ray_transparency_oblique<br />
set ray_transparency_oblique_power, 8<br />
set ray_transparency_contrast, 7<br />
<br />
# fetch a protein, with a <br />
# small molecule in a nice<br />
# hidden pocket<br />
fetch 1hpv, async=0<br />
<br />
hide<br />
<br />
# show the small molecule as surface<br />
show surface, org<br />
<br />
# arrange the view<br />
orient org<br />
<br />
# zoom back a little<br />
zoom org, 1<br />
<br />
# show the small molecule inside as sticks<br />
show sticks, org<br />
<br />
# show some nearby sidechains<br />
show lines, poly within 5 of org<br />
<br />
# enable frame caching for playback<br />
set cache_frames, 1<br />
<br />
set ray_trace_frames, 1<br />
<br />
mset 1x120<br />
<br />
movie.roll 1, 120, 1, x<br />
<br />
mplay<br />
<br />
# now sit back and wait 5 minutes...<br />
</source><br />
|seeAlso=<br />
* [[surface_color]]<br />
* [[surface_mode]]<br />
* [[transparency_mode]]<br />
* [[transparency]]<br />
* [[ray_transparency_oblique]]<br />
* [[ray_transparency_oblique_power]]<br />
* [[ray_transparency_contrast]]<br />
* [[fetch]]<br />
* [[orient]]<br />
* [[zoom]]<br />
* [[show]]<br />
* [[sticks]]<br />
* [[lines]]<br />
* [[cache_frames]]<br />
* [[mset]]<br />
* [[ray_trace_frames]]<br />
* [[movie.roll]]<br />
}}</div>Wayne461https://pymolwiki.org/index.php?title=Grid_mode&diff=9214Grid mode2011-08-03T19:11:42Z<p>Wayne461: </p>
<hr />
<div>== Overview ==<br />
'''grid_mode''' partitions the screen into a grid and displays each molecule in one grid location. Each molecule rotates, zooms, etc in that grid. A possibly very useful option for PyMOL. Each grid area is assigned a [[grid_slot]] number. This allows you to assign objects to certain grids; very helpful. This can be useful when comparing homologous structures and you want to view and rotate the aligned structures side by side. This is similar to a multiple split screen view of the proteins.<br />
<br />
'''Hint:''' When using grid_mode with many molecules, it's sometimes good to align their centers of mass. This puts them all squarely in the middle of their grid element. The '''alignto''' command from [[cealign]] can do this for you.<br />
<br />
'''Hint:''' If you don't want to align the molecules (it's not really necessary for grid_mode) you can just center them on some coordinate. See [[COM]].<br />
<br />
'''Hint:''' For most uses, instead of using the above ways to calculating centering, you may be fine just executing the 'reset' command on the command line after running this mode to get full molecules in view of window and centered.<br />
<br />
'''Note:''' Currently (Mar 29, 2008), grid_mode is only available from source and not from the precompiled versions of PyMOL.<br />
<br />
== Syntax ==<br />
<source lang="python"><br />
# turn on grid mode<br />
set grid_mode,1<br />
<br />
# turn off grid mode<br />
set grid_mode,0<br />
</source><br />
<br />
<br />
== Example ==<br />
<gallery><br />
Image:Gm0.png|grid_mode off. Four molecules shown loaded and aligned.<br />
Image:Gm1.png|grid_mode on. Each molecule is in its own window.<br />
Image:Gm2.png|grid_mode on. Lots of molecules shown.<br />
Image:Wow_grid_mode.png|grid_mode on. 159 proteins shown!<br />
</gallery><br />
<br />
== See Also ==<br />
[[grid_slot]]<br />
<br />
<br />
<br />
[[Category:Settings|Grid_Mode]]</div>Wayne461https://pymolwiki.org/index.php?title=Cartoon&diff=7108Cartoon2009-07-20T23:33:55Z<p>Wayne461: /* Nucleic Acid Representation */</p>
<hr />
<div>==Cartoon Command==<br />
===DESCRIPTION===<br />
'''cartoon''' changes the default cartoon for a set of atoms.<br />
<br />
===USAGE===<br />
<source lang="python"><br />
cartoon type, (selection)<br />
</source><br />
<br />
'''type:'''<br />
#skip<br />
#automatic<br />
#loop<br />
#rectangle<br />
#oval<br />
#tube<br />
#arrow<br />
#dumbbell<br />
<br />
<gallery widths="200px" heights="200px"><br />
Image:Cartoon_skip.png|cartoon_skip; yes, blank.<br />
Image:Cartoon_automatic.png|cartoon_automatic<br />
Image:Cartoon_loop.png|cartoon_loop<br />
Image:Cartoon_rectangle.png|cartoon_rectangle<br />
Image:Cartoon_oval.png|cartoon_oval<br />
Image:Cartoon_tube.png|cartoon_tube<br />
Image:Cartoon_arrow.png|cartoon_arrow<br />
Image:Cartoon_dumbbell.png|cartoon_dumbbell<br />
</gallery><br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.cartoon(string type, string selection )<br />
</source><br />
<br />
===EXAMPLES===<br />
cartoon rectangle,(chain A)<br />
cartoon skip,(resi 145:156)<br />
<br />
===NOTES===<br />
the "automatic" mode utilizes ribbons according to the information in the PDB HELIX and SHEET records.<br />
<br />
==Adjusting width of cartoon==<br />
Try varying the following.<br />
<br />
For &beta;-strands:<br />
<source lang="python"><br />
cartoon_rect_length<br />
cartoon_rect_width<br />
</source><br />
<br />
For &alpha;-helices:<br />
<source lang="python"><br />
cartoon_oval_length<br />
cartoon_oval_width<br />
</source><br />
<br />
For loops:<br />
<source lang="python"><br />
cartoon_loop_radius<br />
</source><br />
<br />
For nucleic acid backbones which resemble 'loops'; however, are not classified as such by Pymol (see more about nucleic acid representation settings at bottom of page):<br />
<source lang="python"><br />
cartoon_tube_radius,0.8<br />
</source><br />
<br />
For "fancy" &alpha;-helices:<br />
<source lang="python"><br />
cartoon_dumbell_length<br />
cartoon_dumbell_width<br />
cartoon_dumbell_radius (radius of cylinder at edge of helix ribbon)<br />
</source><br />
<br />
<br />
In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.<br />
<br />
<br />
[[Image:Cartoon_ex.png|thumb|center|Cartoon Representation Example|300px]]<br />
<br />
<br />
===Forcing Exact Boundaries in Coloring Secondary Structures===<br />
To force PyMol to respect secondary structural elements color-wise (PyMol smooths out colors near color chagnes for a prettier image) use the following <br />
PyMol command:<br />
<code><br />
set cartoon_discrete_colors, on<br />
</code><br />
<br />
[[Image:Cartoon_discrete_color0.png|Discrete Coloring Off|center|thumb]] [[Image:Cartoon_discrete_color1.png|Discrete Coloring On|center|thumb]]<br />
<br />
== Sausage Representation ==<br />
The familiar sausage representation in PyMol is called, "putty". To enable the putty/sausage view simply do,<br />
show cartoon<br />
cartoon putty<br />
unset cartoon_smooth_loops<br />
unset cartoon_flat_sheets<br />
<br />
As of v 0.98 or so, there's a Putty option. Use this.<br />
<br />
[[Image:B_factor_putty.png|thumb|Example of B-factor Putty|center|250px]]<br />
<br />
==Black and White Representation==<br />
'''UPDATE''': This method is essentially obseleted by the new setting '''set ray_trace_mode,2'''. More information on this at [[Ray]].<br />
For those who want a nifty black and white representation of their protein try the following:<br />
# Ray trace your protein of choice in a cartoon representation use a BLACK background<br />
# Save the image<br />
# Load the image in GIMP. [[Image:Bw1.jpeg|thumb|Black BG Ribbon|center|350px]]<br />
# Desaturate or Grayscale the image. [[Image:Bw2.jpeg|thumb|Grayscale|center|350px]]<br />
# Run the filter: Filter->Edge-Detect->Edge. [[Image:Bw3.jpeg|thumb|Edge Detect|center|350px]]<br />
# Select: Layers->Color->Invert. [[Image:Bw4.jpeg|thumb|Invert Color|center|350px]]<br />
# 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. [[Image:Bw5.jpeg|thumb|Other Styles|center|350px|Comments]]<br />
<br />
<br />
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]].<br />
<br />
==CA (Alpha Carbon) Trace==<br />
If you have a structure with just a alpha carbon trace, you can get a cartoon by<br />
<source lang="python"><br />
set cartoon_trace,1<br />
show cartoon<br />
</source><br />
If your structure is more than just the CA backbone, the cartoon representation will look incorrect, so use it just with CA trace.<br />
<br />
==Various Transparency Levels==<br />
[[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'''.]]<br />
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. <br />
<br />
<source lang="python"><br />
load mol_obj.pdb<br />
<br />
# transfer a piece of the molecule into a new object<br />
<br />
create new_obj, chain A<br />
remove mol_obj in new_obj<br />
<br />
# adjust trasparency for the new object<br />
<br />
set cartoon_transparency, 0.5, new_obj<br />
</source><br />
<br />
== Nucleic Acid Representation ==<br />
[[Image:Nucleic1.png|thumb|center|Showing Nucleic Acids]]<br />
To control radius of nucleic acids default backbone cartoon:<br />
<source lang="python"><br />
set cartoon_tube_radius,0.8 #0.5 seems close to the default setting<br />
</source><br />
<br />
To show nucleic acids in a nicer format do:<br />
<source lang="python"><br />
set cartoon_ring_mode,1<br />
show cartoon<br />
</source><br />
<br />
<br />
<br />
=== Other Nucleic Acids & Cartoon Settings ===<br />
Here are some things to try:<br />
<source lang="python"><br />
set cartoon_ring_mode, 1 # (or 2 or 3)<br />
set cartoon_ring_finder, 1 # (or 2 or 3 or 4)<br />
set cartoon_nucleic_acid_mode, 0 # (or 1 or 2 or 3 or 4)<br />
<br />
set cartoon_side_chain_helper<br />
rebuild<br />
<br />
set cartoon_ring_transparency, 0.5<br />
<br />
set cartoon_ladder_mode, 0 # or 1<br />
<br />
set cartoon_ladder_color, color-name<br />
set cartoon_nucleic_acid_color, color-name<br />
<br />
cartoon oval<br />
set cartoon_oval_width, 0.8<br />
<br />
cartoon rect<br />
<br />
cartoon dumbbell<br />
set cartoon_dumbbell_width, 0.4<br />
set cartoon_dumbbell_radius, 0.4<br />
</source><br />
[[Overview of nucleic acid cartoons]]<br />
<br />
[[Examples of nucleic acid cartoons]]<br />
<br />
== See Also ==<br />
[[Displaying_Biochemical_Properties]]<br />
<br />
[[Category:Representations|Cartoon]]<br />
[[Category:Nucleic_Acids|Cartoon]]</div>Wayne461https://pymolwiki.org/index.php?title=Cartoon&diff=7107Cartoon2009-07-20T23:14:50Z<p>Wayne461: /* Adjusting width of cartoon */</p>
<hr />
<div>==Cartoon Command==<br />
===DESCRIPTION===<br />
'''cartoon''' changes the default cartoon for a set of atoms.<br />
<br />
===USAGE===<br />
<source lang="python"><br />
cartoon type, (selection)<br />
</source><br />
<br />
'''type:'''<br />
#skip<br />
#automatic<br />
#loop<br />
#rectangle<br />
#oval<br />
#tube<br />
#arrow<br />
#dumbbell<br />
<br />
<gallery widths="200px" heights="200px"><br />
Image:Cartoon_skip.png|cartoon_skip; yes, blank.<br />
Image:Cartoon_automatic.png|cartoon_automatic<br />
Image:Cartoon_loop.png|cartoon_loop<br />
Image:Cartoon_rectangle.png|cartoon_rectangle<br />
Image:Cartoon_oval.png|cartoon_oval<br />
Image:Cartoon_tube.png|cartoon_tube<br />
Image:Cartoon_arrow.png|cartoon_arrow<br />
Image:Cartoon_dumbbell.png|cartoon_dumbbell<br />
</gallery><br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.cartoon(string type, string selection )<br />
</source><br />
<br />
===EXAMPLES===<br />
cartoon rectangle,(chain A)<br />
cartoon skip,(resi 145:156)<br />
<br />
===NOTES===<br />
the "automatic" mode utilizes ribbons according to the information in the PDB HELIX and SHEET records.<br />
<br />
==Adjusting width of cartoon==<br />
Try varying the following.<br />
<br />
For &beta;-strands:<br />
<source lang="python"><br />
cartoon_rect_length<br />
cartoon_rect_width<br />
</source><br />
<br />
For &alpha;-helices:<br />
<source lang="python"><br />
cartoon_oval_length<br />
cartoon_oval_width<br />
</source><br />
<br />
For loops:<br />
<source lang="python"><br />
cartoon_loop_radius<br />
</source><br />
<br />
For nucleic acid backbones which resemble 'loops'; however, are not classified as such by Pymol (see more about nucleic acid representation settings at bottom of page):<br />
<source lang="python"><br />
cartoon_tube_radius,0.8<br />
</source><br />
<br />
For "fancy" &alpha;-helices:<br />
<source lang="python"><br />
cartoon_dumbell_length<br />
cartoon_dumbell_width<br />
cartoon_dumbell_radius (radius of cylinder at edge of helix ribbon)<br />
</source><br />
<br />
<br />
In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.<br />
<br />
<br />
[[Image:Cartoon_ex.png|thumb|center|Cartoon Representation Example|300px]]<br />
<br />
<br />
===Forcing Exact Boundaries in Coloring Secondary Structures===<br />
To force PyMol to respect secondary structural elements color-wise (PyMol smooths out colors near color chagnes for a prettier image) use the following <br />
PyMol command:<br />
<code><br />
set cartoon_discrete_colors, on<br />
</code><br />
<br />
[[Image:Cartoon_discrete_color0.png|Discrete Coloring Off|center|thumb]] [[Image:Cartoon_discrete_color1.png|Discrete Coloring On|center|thumb]]<br />
<br />
== Sausage Representation ==<br />
The familiar sausage representation in PyMol is called, "putty". To enable the putty/sausage view simply do,<br />
show cartoon<br />
cartoon putty<br />
unset cartoon_smooth_loops<br />
unset cartoon_flat_sheets<br />
<br />
As of v 0.98 or so, there's a Putty option. Use this.<br />
<br />
[[Image:B_factor_putty.png|thumb|Example of B-factor Putty|center|250px]]<br />
<br />
==Black and White Representation==<br />
'''UPDATE''': This method is essentially obseleted by the new setting '''set ray_trace_mode,2'''. More information on this at [[Ray]].<br />
For those who want a nifty black and white representation of their protein try the following:<br />
# Ray trace your protein of choice in a cartoon representation use a BLACK background<br />
# Save the image<br />
# Load the image in GIMP. [[Image:Bw1.jpeg|thumb|Black BG Ribbon|center|350px]]<br />
# Desaturate or Grayscale the image. [[Image:Bw2.jpeg|thumb|Grayscale|center|350px]]<br />
# Run the filter: Filter->Edge-Detect->Edge. [[Image:Bw3.jpeg|thumb|Edge Detect|center|350px]]<br />
# Select: Layers->Color->Invert. [[Image:Bw4.jpeg|thumb|Invert Color|center|350px]]<br />
# 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. [[Image:Bw5.jpeg|thumb|Other Styles|center|350px|Comments]]<br />
<br />
<br />
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]].<br />
<br />
==CA (Alpha Carbon) Trace==<br />
If you have a structure with just a alpha carbon trace, you can get a cartoon by<br />
<source lang="python"><br />
set cartoon_trace,1<br />
show cartoon<br />
</source><br />
If your structure is more than just the CA backbone, the cartoon representation will look incorrect, so use it just with CA trace.<br />
<br />
==Various Transparency Levels==<br />
[[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'''.]]<br />
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. <br />
<br />
<source lang="python"><br />
load mol_obj.pdb<br />
<br />
# transfer a piece of the molecule into a new object<br />
<br />
create new_obj, chain A<br />
remove mol_obj in new_obj<br />
<br />
# adjust trasparency for the new object<br />
<br />
set cartoon_transparency, 0.5, new_obj<br />
</source><br />
<br />
== Nucleic Acid Representation ==<br />
[[Image:Nucleic1.png|thumb|center|Showing Nucleic Acids]]<br />
To control radius of nucleic acids default backbone cartoon:<br />
<source lang="python"><br />
set cartoon_tube_radius,0.8<br />
</source><br />
<br />
To show nucleic acids in a nicer format do:<br />
<source lang="python"><br />
set cartoon_ring_mode,1<br />
show cartoon<br />
</source><br />
<br />
<br />
<br />
=== Other Nucleic Acids & Cartoon Settings ===<br />
Here are some things to try:<br />
<source lang="python"><br />
set cartoon_ring_mode, 1 # (or 2 or 3)<br />
set cartoon_ring_finder, 1 # (or 2 or 3 or 4)<br />
set cartoon_nucleic_acid_mode, 0 # (or 1 or 2 or 3 or 4)<br />
<br />
set cartoon_side_chain_helper<br />
rebuild<br />
<br />
set cartoon_ring_transparency, 0.5<br />
<br />
set cartoon_ladder_mode, 0 # or 1<br />
<br />
set cartoon_ladder_color, color-name<br />
set cartoon_nucleic_acid_color, color-name<br />
<br />
cartoon oval<br />
set cartoon_oval_width, 0.8<br />
<br />
cartoon rect<br />
<br />
cartoon dumbbell<br />
set cartoon_dumbbell_width, 0.4<br />
set cartoon_dumbbell_radius, 0.4<br />
</source><br />
[[Overview of nucleic acid cartoons]]<br />
<br />
[[Examples of nucleic acid cartoons]]<br />
<br />
== See Also ==<br />
[[Displaying_Biochemical_Properties]]<br />
<br />
[[Category:Representations|Cartoon]]<br />
[[Category:Nucleic_Acids|Cartoon]]</div>Wayne461https://pymolwiki.org/index.php?title=Cartoon&diff=7106Cartoon2009-07-20T23:06:47Z<p>Wayne461: /* Nucleic Acid Representation */</p>
<hr />
<div>==Cartoon Command==<br />
===DESCRIPTION===<br />
'''cartoon''' changes the default cartoon for a set of atoms.<br />
<br />
===USAGE===<br />
<source lang="python"><br />
cartoon type, (selection)<br />
</source><br />
<br />
'''type:'''<br />
#skip<br />
#automatic<br />
#loop<br />
#rectangle<br />
#oval<br />
#tube<br />
#arrow<br />
#dumbbell<br />
<br />
<gallery widths="200px" heights="200px"><br />
Image:Cartoon_skip.png|cartoon_skip; yes, blank.<br />
Image:Cartoon_automatic.png|cartoon_automatic<br />
Image:Cartoon_loop.png|cartoon_loop<br />
Image:Cartoon_rectangle.png|cartoon_rectangle<br />
Image:Cartoon_oval.png|cartoon_oval<br />
Image:Cartoon_tube.png|cartoon_tube<br />
Image:Cartoon_arrow.png|cartoon_arrow<br />
Image:Cartoon_dumbbell.png|cartoon_dumbbell<br />
</gallery><br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.cartoon(string type, string selection )<br />
</source><br />
<br />
===EXAMPLES===<br />
cartoon rectangle,(chain A)<br />
cartoon skip,(resi 145:156)<br />
<br />
===NOTES===<br />
the "automatic" mode utilizes ribbons according to the information in the PDB HELIX and SHEET records.<br />
<br />
==Adjusting width of cartoon==<br />
Try varying the following.<br />
<br />
For &beta;-strands:<br />
<source lang="python"><br />
cartoon_rect_length<br />
cartoon_rect_width<br />
</source><br />
<br />
For &alpha;-helices:<br />
<source lang="python"><br />
cartoon_oval_length<br />
cartoon_oval_width<br />
</source><br />
<br />
For loops:<br />
<source lang="python"><br />
cartoon_loop_radius<br />
</source><br />
<br />
For "fancy" &alpha;-helices:<br />
<source lang="python"><br />
cartoon_dumbell_length<br />
cartoon_dumbell_width<br />
cartoon_dumbell_radius (radius of cylinder at edge of helix ribbon)<br />
</source><br />
<br />
In each case "length" refers to what some might call the width and "width" refers to what some might call the thickness.<br />
<br />
<br />
[[Image:Cartoon_ex.png|thumb|center|Cartoon Representation Example|300px]]<br />
<br />
<br />
===Forcing Exact Boundaries in Coloring Secondary Structures===<br />
To force PyMol to respect secondary structural elements color-wise (PyMol smooths out colors near color chagnes for a prettier image) use the following <br />
PyMol command:<br />
<code><br />
set cartoon_discrete_colors, on<br />
</code><br />
<br />
[[Image:Cartoon_discrete_color0.png|Discrete Coloring Off|center|thumb]] [[Image:Cartoon_discrete_color1.png|Discrete Coloring On|center|thumb]]<br />
<br />
== Sausage Representation ==<br />
The familiar sausage representation in PyMol is called, "putty". To enable the putty/sausage view simply do,<br />
show cartoon<br />
cartoon putty<br />
unset cartoon_smooth_loops<br />
unset cartoon_flat_sheets<br />
<br />
As of v 0.98 or so, there's a Putty option. Use this.<br />
<br />
[[Image:B_factor_putty.png|thumb|Example of B-factor Putty|center|250px]]<br />
<br />
==Black and White Representation==<br />
'''UPDATE''': This method is essentially obseleted by the new setting '''set ray_trace_mode,2'''. More information on this at [[Ray]].<br />
For those who want a nifty black and white representation of their protein try the following:<br />
# Ray trace your protein of choice in a cartoon representation use a BLACK background<br />
# Save the image<br />
# Load the image in GIMP. [[Image:Bw1.jpeg|thumb|Black BG Ribbon|center|350px]]<br />
# Desaturate or Grayscale the image. [[Image:Bw2.jpeg|thumb|Grayscale|center|350px]]<br />
# Run the filter: Filter->Edge-Detect->Edge. [[Image:Bw3.jpeg|thumb|Edge Detect|center|350px]]<br />
# Select: Layers->Color->Invert. [[Image:Bw4.jpeg|thumb|Invert Color|center|350px]]<br />
# 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. [[Image:Bw5.jpeg|thumb|Other Styles|center|350px|Comments]]<br />
<br />
<br />
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]].<br />
<br />
==CA (Alpha Carbon) Trace==<br />
If you have a structure with just a alpha carbon trace, you can get a cartoon by<br />
<source lang="python"><br />
set cartoon_trace,1<br />
show cartoon<br />
</source><br />
If your structure is more than just the CA backbone, the cartoon representation will look incorrect, so use it just with CA trace.<br />
<br />
==Various Transparency Levels==<br />
[[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'''.]]<br />
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. <br />
<br />
<source lang="python"><br />
load mol_obj.pdb<br />
<br />
# transfer a piece of the molecule into a new object<br />
<br />
create new_obj, chain A<br />
remove mol_obj in new_obj<br />
<br />
# adjust trasparency for the new object<br />
<br />
set cartoon_transparency, 0.5, new_obj<br />
</source><br />
<br />
== Nucleic Acid Representation ==<br />
[[Image:Nucleic1.png|thumb|center|Showing Nucleic Acids]]<br />
To control radius of nucleic acids default backbone cartoon:<br />
<source lang="python"><br />
set cartoon_tube_radius,0.8<br />
</source><br />
<br />
To show nucleic acids in a nicer format do:<br />
<source lang="python"><br />
set cartoon_ring_mode,1<br />
show cartoon<br />
</source><br />
<br />
<br />
<br />
=== Other Nucleic Acids & Cartoon Settings ===<br />
Here are some things to try:<br />
<source lang="python"><br />
set cartoon_ring_mode, 1 # (or 2 or 3)<br />
set cartoon_ring_finder, 1 # (or 2 or 3 or 4)<br />
set cartoon_nucleic_acid_mode, 0 # (or 1 or 2 or 3 or 4)<br />
<br />
set cartoon_side_chain_helper<br />
rebuild<br />
<br />
set cartoon_ring_transparency, 0.5<br />
<br />
set cartoon_ladder_mode, 0 # or 1<br />
<br />
set cartoon_ladder_color, color-name<br />
set cartoon_nucleic_acid_color, color-name<br />
<br />
cartoon oval<br />
set cartoon_oval_width, 0.8<br />
<br />
cartoon rect<br />
<br />
cartoon dumbbell<br />
set cartoon_dumbbell_width, 0.4<br />
set cartoon_dumbbell_radius, 0.4<br />
</source><br />
[[Overview of nucleic acid cartoons]]<br />
<br />
[[Examples of nucleic acid cartoons]]<br />
<br />
== See Also ==<br />
[[Displaying_Biochemical_Properties]]<br />
<br />
[[Category:Representations|Cartoon]]<br />
[[Category:Nucleic_Acids|Cartoon]]</div>Wayne461https://pymolwiki.org/index.php?title=Overview_of_nucleic_acid_cartoons&diff=6255Overview of nucleic acid cartoons2009-04-17T22:45:38Z<p>Wayne461: /* Nucleic acid mode */</p>
<hr />
<div>== Overview ==<br />
<br />
Pymol has a complex group of settings for controlling the way nucleic acids are represented, broadly separated into:<br />
* ring, for ribose and base ring(s)<br />
* ladder, for the sticks connecting the backbone, ribose and base ring(s)<br />
* nucleic acid, for the smooth backbone path<br />
<br />
Each setting can be altered with the set command. The cartoon settings affect each other so experimentation may be necessary to achieve what you want. Many of the mode settings only seem to work at the global level and cannot be applied to individual objects or selections.<br />
<br />
== Ring settings ==<br />
<br />
=== Ring mode ===<br />
<br />
Ring mode defines the representation of the ribose and base.<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 6+ || appears to default to ring mode 2<br />
|}<br />
=== Ring finder ===<br />
<br />
Ring finder defines the rings which are recognised<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|-<br />
|align="center" | 6+ || appears to default to ring finder 5<br />
|}<br />
<br />
=== Other settings for ring ===<br />
<pre>set cartoon_ring_xxx, value</pre><br />
{|<br />
! align="center" | xxx !! value !! align="left" | effect<br />
|-<br />
|align="center" | color || align="center" |color || set the colour of the ring or sphere<br />
|-<br />
|align="center" | width || align="center" | float || thickness of ring for planes and sticks (modes 1, 2, 3)<br />
|-<br />
|align="center" | radius || align="center" |float || radius of ring for spheres (modes 4, 5), negative number gives sphere of same radius as ring in mode 4, approx 1/10 ring diameter in mode 5<br />
|-<br />
|align="center" | transparency || align="center" |float || transparency of ring or sphere, does not affect sticks in ring mode 3<br />
|}<br />
<br />
== Ladder settings ==<br />
<br />
=== Ladder mode ===<br />
<br />
Ladder mode affects the sticks connecting the backbone to ribose and ribose to base, and ring mode 0 or ring finder 5.<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|-<br />
|align="center" | 2+ || appears to default to ladder mode 1<br />
|}<br />
=== Other settings for ladder ===<br />
<pre>set cartoon_ladder_xxx, value</pre><br />
{|<br />
! align="center" | xxx !! value !! align="left" | effect<br />
|-<br />
|align="center" | color || color || colour of the stick<br />
|-<br />
|align="center" | radius || float || stick width for ring modes 1, 4 and 5 (default is 0.25), in other ring modes the ladder stick width is controlled by the ring width instead<br />
|}<br />
<br />
== Nucleic acid settings ==<br />
<br />
=== Nucleic acid mode ===<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0<br />
|-<br />
|align="center" | 4 || appears same as mode 2? Seems to be what Pymol uses when it first opens nucleic acid containing file because any other settings change ends and colors. <!--to see this in action open 1e7k and focus on chain c--><br />
|-<br />
|align="center" | 5+ || appears to defult to nucleic acid mode 0<br />
|}<br />
==== Note ====<br />
Note that in ring mode 0 or ring finder 2 the stick projects from the backbone at a point midway between phosphates<br />
<pre>set ribbon_nucleic_acid_mode, value</pre><br />
{|<br />
! align="center" |xxx !! value !! align="left" | effect<br />
|-<br />
|align="center" | ribbon_nucleic_acid_mode || align="center" | integer || has the equivalent behaviour to cartoon_nucleic_acid_mode<br />
|}<br />
<br />
=== Other settings for nucleic acid ===<br />
<pre>set cartoon_nucleic_acid_xxx, value</pre><br />
{|<br />
! xxx !! value !! align="left" | effect<br />
|-<br />
|align="center" | color || color || backbone colour (default is backbone atom colour)<br />
|}</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6254Examples of nucleic acid cartoons2009-04-17T22:43:30Z<p>Wayne461: /* Default settings */</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 0 # backbone follows phosphates; actually Pymol itself uses setting '4' as default<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 4 which is for following phosphates and colors the same when I look at RNA ends of 1e7k. None of the other settings looked as same as it did when opening Pymol. Any other settings don't look like the default I see when opening Pymol for RNA in 1e7k. --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2? Seems to be what Pymol uses when it first opens nucleic acid containing file because any other settings change ends and colors. <!--to see this in action open 1e7k and focus on chain c--><br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6253Examples of nucleic acid cartoons2009-04-17T22:43:12Z<p>Wayne461: /* Default settings */</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 0 # backbone follows phosphates; actually Pymol itself uses setting '4' as defaul<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 4 which is for following phosphates and colors the same when I look at RNA ends of 1e7k. None of the other settings looked as same as it did when opening Pymol. Any other settings don't look like the default I see when opening Pymol for RNA in 1e7k. --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2? Seems to be what Pymol uses when it first opens nucleic acid containing file because any other settings change ends and colors. <!--to see this in action open 1e7k and focus on chain c--><br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6252Examples of nucleic acid cartoons2009-04-17T22:42:48Z<p>Wayne461: /* Default settings */</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 0 # backbone follows phosphates; actually Pymol uses setting '4' as default when opens a new file<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 4 which is for following phosphates and colors the same when I look at RNA ends of 1e7k. None of the other settings looked as same as it did when opening Pymol. Any other settings don't look like the default I see when opening Pymol for RNA in 1e7k. --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2? Seems to be what Pymol uses when it first opens nucleic acid containing file because any other settings change ends and colors. <!--to see this in action open 1e7k and focus on chain c--><br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461https://pymolwiki.org/index.php?title=User:Wayne461&diff=6203User:Wayne4612009-04-17T20:24:42Z<p>Wayne461: New page: See [http://www.proteopedia.org/wiki/index.php/User:Wayne_Decatur Wayne's Proteopedia page].</p>
<hr />
<div>See [http://www.proteopedia.org/wiki/index.php/User:Wayne_Decatur Wayne's Proteopedia page].</div>Wayne461https://pymolwiki.org/index.php?title=Lines&diff=6201Lines2009-04-17T20:22:24Z<p>Wayne461: /* See Also */</p>
<hr />
<div>=Overview=<br />
'''Lines''' is name of the basic representation for atoms and bonds in PyMOL. '''Lines''' is a very simple representation, where each atom bond is displayed as a single colored line, and each atom is displayed as the intersection of any two or more non-terminal bonds.<br />
<br />
=Usage=<br />
<source lang="python"><br />
# show everything as lines<br />
show lines<br />
<br />
# only show residues 50-80 as lines<br />
show lines, i.50-80<br />
</source><br />
<br />
==Examples==<br />
===Example: Displaying dashed lines between two atoms===<br />
The following commands will create a dashed line between two atoms.<br />
<source lang="python"><br />
# first, create two named selections<br />
select a, ///A/501/02<br />
select b, ///B/229/N<br />
# calculate & show the distance from selection a to selection b.<br />
distance d, a, b<br />
# hide just the distance labels; the <br />
# dashed bars should still be shown<br />
hide labels, d<br />
</source><br />
<br />
Technically, the object ''d'' is a labelled distance, only the label is hidden. <br />
When ray-tracing the image, the dashes come out a bit fat. You can slim them with<br />
<source lang="python"><br />
set dash_gap, 0.5<br />
set dash_radius, 0.1<br />
</source><br />
before the 'ray' command.<br />
<br />
[[Image:Lines_ex.png|thumb|Lines Representation Example]]<br />
<br />
==See Also==<br />
Please read about other representations in the '''[[:Category:Representations|Representation Category]]'''. <br><br />
[[Measure_Distance]] <br><br />
[[Distance]] <br><br />
<br />
<br />
<br />
[[Category:Representations]]<br />
[[Category:Commands|distance]]</div>Wayne461https://pymolwiki.org/index.php?title=Distance&diff=6200Distance2009-04-17T20:17:01Z<p>Wayne461: /* SEE ALSO */</p>
<hr />
<div>===DESCRIPTION===<br />
'''distance''' creates a new distance object between two selections. It will display all distances within the cutoff.<br />
<br />
<center><br />
<gallery><br />
Image:Dist ex1.png|Example of distance. See example #1.<br />
Image:Dist ex2.png|Example of distance. See example #2.<br />
</gallery><br />
</center><br />
<br />
===USAGE===<br />
<source lang="python"><br />
distance (selection1), (selection2)<br />
<br />
# example<br />
dist i. 158 and n. CA, i. 160 and n. CA <br />
</source><br />
<br />
distance name = (selection1), (selection2) [,cutoff [,mode] ]<br />
<br />
* name = name of distance object <br />
* selection1, selection2 = atom selections<br />
* cutoff = maximum distance to display<br />
* mode = 0 (default)<br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.distance( string name, string selection1, string selection2,<br />
string cutoff, string mode )<br />
# returns the average distance between all atoms/frames<br />
</source><br />
<br />
===NOTES===<br />
The distance wizard makes measuring distances easier than using the "dist" command for real-time operations.<br />
<br />
"dist" alone will show distances between selections (pk1) and (pk1), which can be set using the PkAt mouse action (usually CTRL-middle-click). <br />
<br />
===EXAMPLES===<br />
* Get and show the distance from residue 10's alpha carbon to residue 40's alpha carbon in 1ESR:<br />
<source lang="python"><br />
# make the first residue 0.<br />
zero_residues 1esr, 0<br />
distance i. 10 and n . CA, i. 40 and n. CA<br />
</source><br />
<br />
* Get and show the distance from residue 10's alpha carbon to residue 35-42's alpha carbon in 1ESR:<br />
<source lang="python"><br />
# make the first residue 0.<br />
zero_residues 1esr, 0<br />
distance i. 10 and n . CA, i. 35-42 and n. CA<br />
</source><br />
<br />
* This neat example shows how to create distance measurements from an atom in a molecule to all other atoms in the molecule (since PyMol supports wildcards).<br />
<source lang="python"><br />
cmd.dist("(/mol1///1/C)","(/mol1///2/C*)")<br />
</source><br />
or written without the PyMolScript code,<br />
dist /mol1///1/C, /mol1///2/C*<br />
* Create multiple distance objects<br />
<source lang="python"><br />
for at1 in cmd.index("resi 10"): \<br />
for at2 in cmd.index("resi 11"): \<br />
cmd.dist(None, "%s`%d"%at1, "%s`%d"%at2)<br />
</source><br />
<br />
===SEE ALSO===<br />
[[Measure_Distance]]<br><br />
[[Lines]]<br />
<br />
[[Category:Commands|distance]]</div>Wayne461https://pymolwiki.org/index.php?title=Lines&diff=6198Lines2009-04-17T20:16:06Z<p>Wayne461: /* See Also */</p>
<hr />
<div>=Overview=<br />
'''Lines''' is name of the basic representation for atoms and bonds in PyMOL. '''Lines''' is a very simple representation, where each atom bond is displayed as a single colored line, and each atom is displayed as the intersection of any two or more non-terminal bonds.<br />
<br />
=Usage=<br />
<source lang="python"><br />
# show everything as lines<br />
show lines<br />
<br />
# only show residues 50-80 as lines<br />
show lines, i.50-80<br />
</source><br />
<br />
==Examples==<br />
===Example: Displaying dashed lines between two atoms===<br />
The following commands will create a dashed line between two atoms.<br />
<source lang="python"><br />
# first, create two named selections<br />
select a, ///A/501/02<br />
select b, ///B/229/N<br />
# calculate & show the distance from selection a to selection b.<br />
distance d, a, b<br />
# hide just the distance labels; the <br />
# dashed bars should still be shown<br />
hide labels, d<br />
</source><br />
<br />
Technically, the object ''d'' is a labelled distance, only the label is hidden. <br />
When ray-tracing the image, the dashes come out a bit fat. You can slim them with<br />
<source lang="python"><br />
set dash_gap, 0.5<br />
set dash_radius, 0.1<br />
</source><br />
before the 'ray' command.<br />
<br />
[[Image:Lines_ex.png|thumb|Lines Representation Example]]<br />
<br />
==See Also==<br />
Please read about other representations in the '''Representation Category'''. <br><br />
[[Measure_Distance]] <br><br />
[[Distance]] <br><br />
<br />
<br />
<br />
[[Category:Representations]]<br />
[[Category:Commands|distance]]</div>Wayne461https://pymolwiki.org/index.php?title=Lines&diff=6197Lines2009-04-17T20:15:43Z<p>Wayne461: </p>
<hr />
<div>=Overview=<br />
'''Lines''' is name of the basic representation for atoms and bonds in PyMOL. '''Lines''' is a very simple representation, where each atom bond is displayed as a single colored line, and each atom is displayed as the intersection of any two or more non-terminal bonds.<br />
<br />
=Usage=<br />
<source lang="python"><br />
# show everything as lines<br />
show lines<br />
<br />
# only show residues 50-80 as lines<br />
show lines, i.50-80<br />
</source><br />
<br />
==Examples==<br />
===Example: Displaying dashed lines between two atoms===<br />
The following commands will create a dashed line between two atoms.<br />
<source lang="python"><br />
# first, create two named selections<br />
select a, ///A/501/02<br />
select b, ///B/229/N<br />
# calculate & show the distance from selection a to selection b.<br />
distance d, a, b<br />
# hide just the distance labels; the <br />
# dashed bars should still be shown<br />
hide labels, d<br />
</source><br />
<br />
Technically, the object ''d'' is a labelled distance, only the label is hidden. <br />
When ray-tracing the image, the dashes come out a bit fat. You can slim them with<br />
<source lang="python"><br />
set dash_gap, 0.5<br />
set dash_radius, 0.1<br />
</source><br />
before the 'ray' command.<br />
<br />
[[Image:Lines_ex.png|thumb|Lines Representation Example]]<br />
<br />
==See Also==<br />
Please read about other representations in the '''Representation Category'''.<br />
[[Measure_Distance]]<br />
[[Distance]]<br />
<br />
<br />
<br />
[[Category:Representations]]<br />
[[Category:Commands|distance]]</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6090Examples of nucleic acid cartoons2009-04-15T20:50:19Z<p>Wayne461: /* Settings for nucleic acid mode updated to list what pymol uses when it opens*/</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 4 # backbone follows phosphates<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 4 which is for following phosphates and colors the same when I look at RNA ends of 1e7k. None of the other settings looked as same as it did when opening Pymol. Any other settings don't look like the default I see when opening Pymol for RNA in 1e7k. --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2? Seems to be what Pymol uses when it first opens nucleic acid containing file because any other settings change ends and colors. <!--to see this in action open 1e7k and focus on chain c--><br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6089Examples of nucleic acid cartoons2009-04-15T20:48:14Z<p>Wayne461: /* Default settings for cartoon_nucleic_acid_mode updated to what I actually see when I open 1e7k*/</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 4 # backbone follows phosphates<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 4 which is for following phosphates and colors the same when I look at RNA ends of 1e7k. None of the other settings looked as same as it did when opening Pymol. Any other settings don't look like the default I see when opening Pymol for RNA in 1e7k. --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2?<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461https://pymolwiki.org/index.php?title=Examples_of_nucleic_acid_cartoons&diff=6088Examples of nucleic acid cartoons2009-04-15T20:30:50Z<p>Wayne461: /* Default settings had wrong nucleic acid mode and was thus fixed, I hope */</p>
<hr />
<div>== Default settings ==<br />
The defaults give a phosphate backbone with single sticks passing across the full width of the base plane.<br />
<source lang="python"><br />
set cartoon_nucleic_acid_mode, 0 # backbone follows phosphates<br />
set cartoon_ladder_mode, 1 # sticks from backbone into nucleotide<br />
set cartoon_ring_mode, 0 # no nucleotide rings<br />
set cartoon_ring_finder, 1 # ribose and base rings (not displayed since ring mode 0)<br />
</source><br />
{|<br />
|[[Image:DNA-default-ring0-ladder1-na0-finder1.png|default view|thumb]]<br />
|}<br />
<!-- Prior to 4-15-09 cartoon_nucleic_acid_mode had been listed as being default value of 1 but this would go through C3, right? Fixed so value listed for cartoon_nucleic_acid_mode is 0 which is for following phosphates --><br />
<br />
== Cartoon ring mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ring_mode, value</pre><br />
{|}<br />
!value !!align="left"| effect<br />
|-<br />
|align="center" | 0 || stick from backbone atom to N1 of purines and N3 of pyrimidines<br />
|-<br />
|align="center" | 1 || simple plane for ribose and base rings covering area between ring bonds<br />
|-<br />
|align="center" | 2 || simple plane for ribose and base rings covering area inside sticks (slightly smaller than mode 1)<br />
|-<br />
|align="center" | 3 || plane bounded by sticks for ribose and base rings<br />
|-<br />
|align="center" | 4 || large sphere of ring diameter at centre of ribose and each base ring<br />
|-<br />
|align="center" | 5 || small sphere of 1/10 diameter at centre of ribose and each base ring<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring0-ladder1-na0-finder1.png|cartoon_ring_mode,0|thumb]]<br />
|[[Image:DNA-ring1-ladder1-na0-finder1.png|cartoon_ring_mode,1|thumb]]<br />
|[[Image:DNA-ring2-ladder1-na0-finder1.png|cartoon_ring_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_mode,3|thumb]]<br />
|[[Image:DNA-ring4-ladder1-na0-finder1.png|cartoon_ring_mode,4|thumb]]<br />
|[[Image:DNA-ring5-ladder1-na0-finder1.png|cartoon_ring_mode,5|thumb]]<br />
|}<br />
<center>all with defaults:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i></center><br />
<br />
== Cartoon ring finder ==<br />
<br />
=== Settings ===<br />
<pre>set cartoon_ring_finder, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no rings or sticks joining them<br />
|-<br />
|align="center" | 1 || both ribose and base ring<br />
|-<br />
|align="center" | 2 || only base ring(s), stick connects directly from phosphate to ring<br />
|-<br />
|align="center" | 3 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 4 || very similar to ring finder 1, slight effect on transparency = distinct behaviour?<br />
|-<br />
|align="center" | 5 || sticks visible but rings invisible<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder0.png|cartoon_ring_finder,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ring_finder,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder2.png|cartoon_ring_finder,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder3.png|cartoon_ring_finder,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder4.png|cartoon_ring_finder,4|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder5.png|cartoon_ring_finder,5|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,1&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0</i><br />
<br />
== Cartoon ladder mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_ladder_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" | 0 || no sticks shown<br />
|-<br />
|align="center" | 1 || sticks show<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder0-na0-finder1.png|cartoon_ladder_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_ladder_mode,1|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_nucleic_acid_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
Note that the visibility of the ladder sticks depends on ring mode >0, ring finder >0, nucleic acid mode = 0<br />
<br />
== Cartoon nucleic acid mode ==<br />
<br />
=== Settings ===<br />
<br />
<pre>set cartoon_nucleic_acid_mode, value</pre><br />
{|<br />
!value !! align="left" | effect<br />
|-<br />
|align="center" |0 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on either end of chain <br />
|-<br />
|align="center" | 1 || smooth backbone passing through ribose C3' atoms, backbone terminates at last C3' on either end of chain<br />
|-<br />
|align="center" | 2 || smooth backbone passing through phosphorus atoms, backbone terminates at last phosphorus on 5' end and O3' on 3' end (note takes O3' colour at terminus in default colouring)<br />
|-<br />
|align="center" | 3 || appears same as mode 0?<br />
|-<br />
|align="center" | 4 || appears same as mode 2?<br />
|}<br />
<br />
=== Examples ===<br />
<br />
{|<br />
|[[Image:DNA-ring3-ladder1-na0-finder1.png|cartoon_nucleic_acid_mode,0|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na1-finder1.png|cartoon_nucleic_acid_mode,1|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na2-finder1.png|cartoon_nucleic_acid_mode,2|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na3-finder1.png|cartoon_nucleic_acid_mode,3|thumb]]<br />
|[[Image:DNA-ring3-ladder1-na4-finder1.png|cartoon_nucleic_acid_mode,4|thumb]]<br />
|}<br />
all with:&nbsp;<i>cartoon_ladder_mode,0&nbsp;&nbsp;&nbsp;cartoon_ring_mode,3&nbsp;&nbsp;&nbsp;cartoon_ring_finder,1</i><br />
<br />
[[Category:Nucleic_Acids|Cartoon ring and cartoon ladder settings]]</div>Wayne461