https://pymolwiki.org/api.php?action=feedcontributions&user=Jaredsampson&feedformat=atomPyMOLWiki - User contributions [en]2024-03-29T15:17:35ZUser contributionsMediaWiki 1.35.7https://pymolwiki.org/index.php?title=Get_Title&diff=13528Get Title2023-01-19T19:09:11Z<p>Jaredsampson: /* PYMOL API */ change to get_title API (this was apparently copied from the set_title page)</p>
<hr />
<div><br />
'''get_title''' retrieves a text string to the state of a particular object which will be displayed when the state is active. This is useful for printing the names of objects (given a state).<br />
<br />
==USAGE==<br />
<source lang="python"><br />
get_title object,state<br />
</source><br />
<br />
==PYMOL API==<br />
<source lang="python"><br />
cmd.get_title(string object, int state) <br />
</source><br />
<br />
== Example ==<br />
Print out all the object names of the ensemble of states loaded in:<br />
<source lang="python"><br />
for x in range(numStates):<br />
print cmd.get_title("objName", x)<br />
</source><br />
<br />
[[Category:Commands|Get Title]]<br />
[[Category:States|Get Title]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Get_Title&diff=13527Get Title2023-01-19T19:08:11Z<p>Jaredsampson: /* USAGE */ fix typo in command name</p>
<hr />
<div><br />
'''get_title''' retrieves a text string to the state of a particular object which will be displayed when the state is active. This is useful for printing the names of objects (given a state).<br />
<br />
==USAGE==<br />
<source lang="python"><br />
get_title object,state<br />
</source><br />
<br />
==PYMOL API==<br />
<source lang="python"><br />
cmd.set_title(string object,int state,string text) <br />
</source><br />
<br />
== Example ==<br />
Print out all the object names of the ensemble of states loaded in:<br />
<source lang="python"><br />
for x in range(numStates):<br />
print cmd.get_title("objName", x)<br />
</source><br />
<br />
[[Category:Commands|Get Title]]<br />
[[Category:States|Get Title]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13484CGO Shapes2022-02-15T21:41:58Z<p>Jaredsampson: </p>
<hr />
<div>A Compiled Graphics Object (CGO) is a Python list of floating point numbers, which is compiled by PyMOL into an geometric representation and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
<br />
[[Category:CGO]]<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [cgo.CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery><br />
<br />
<br />
<br />
===SEE ALSO===<br />
* [[Load_CGO]]<br />
* [[cgo_transparency]]<br />
<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Cgo_transparency&diff=13483Cgo transparency2022-02-14T02:53:13Z<p>Jaredsampson: Add more details to usage and arguments</p>
<hr />
<div>This is an object-level setting to control transparency of Compiled Graphics Objects.<br />
<br />
Usage:<br />
<br />
<source lang="python"><br />
# PyMOL command<br />
set cgo_transparency, value [, object]<br />
<br />
# Python API<br />
cmd.set("cgo_transparency", value [, object])<br />
</source><br />
<br />
Arguments<br />
* value (float) number between 0 and 1 (with 0 meaning the object is opaque, and 1 == invisible).<br />
* object (str) name of the object to which to apply the setting (default: all CGO objects)<br />
<br />
[[Category:Settings]]<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13482CGO Shapes2022-02-14T02:46:10Z<p>Jaredsampson: Add See Also section</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
<br />
[[Category:CGO]]<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [cgo.CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery><br />
<br />
<br />
<br />
===SEE ALSO===<br />
* [[Load_CGO]]<br />
* [[cgo_transparency]]<br />
<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13481CGO Shapes2022-02-14T02:41:55Z<p>Jaredsampson: /* EXAMPLES */ fix missing namespace for cgo.CONE</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
<br />
[[Category:CGO]]<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [cgo.CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery><br />
<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13480CGO Shapes2022-02-14T02:34:47Z<p>Jaredsampson: Add Category:CGO</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
<br />
[[Category:CGO]]<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery><br />
<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13479CGO Shapes2022-02-14T02:33:24Z<p>Jaredsampson: Add category:CGO</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
<br />
[[Category:CGO]]<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery></div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13478CGO Shapes2022-02-14T02:31:17Z<p>Jaredsampson: /* EXAMPLES */ add image for the above examples</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
<br />
# adjust the camera position<br />
set_view (\<br />
0.022470249, 0.398223877, -0.917012811,\<br />
0.188309744, 0.899140060, 0.395077318,\<br />
0.981853366, -0.181560174, -0.054785311,\<br />
0.000002960, -0.000002829, -28.313688278,\<br />
1.387665749, 1.797374249, 2.392468214,\<br />
21.653684616, 34.973686218, -20.000000000 )<br />
<br />
# force a black background and save a PNG image<br />
set ray_opaque_background, 1<br />
png cgo_examples.png, ray=1<br />
</source><br />
<br />
<gallery heights="300" widths="400"><br />
Image:cgo_examples.jpg|Figure produced by the above example code.<br />
</gallery></div>Jaredsampsonhttps://pymolwiki.org/index.php?title=File:Cgo_examples.jpg&diff=13477File:Cgo examples.jpg2022-02-14T02:26:46Z<p>Jaredsampson: Assorted rendered CGO objects in PyMOL.</p>
<hr />
<div>== Summary ==<br />
Assorted rendered CGO objects in PyMOL.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13476CGO Shapes2022-02-14T02:20:32Z<p>Jaredsampson: Add examples and CONE</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
Based on an old version of the User Manual:<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
<br />
CONE, x1, y1, z1,<br />
x2, y2, z2,<br />
r1, r2,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
cap1, cap2 # should the ends be solid (1) or open (0)? <br />
</pre><br />
<br />
<br />
=== EXAMPLES ===<br />
<br />
<source lang="python"><br />
from pymol import cgo<br />
<br />
# Unit sphere at the origin<br />
plain_sphere = [cgo.SPHERE, 0, 0, 0, 1]<br />
cmd.load_cgo(plain_sphere, "plain_sphere")<br />
<br />
# Red unit sphere at (3, 4, 5)<br />
red_sphere = [cgo.COLOR, 1, 0, 0, cgo.SPHERE, 3, 4, 5, 1]<br />
cmd.load_cgo(red_sphere, "red_sphere")<br />
<br />
# Narrow yellow cylinder<br />
pos0 = [-1, -1, -1]<br />
pos1 = [-1, -1, 1]<br />
r = 0.1<br />
yellow = [1, 1, 0]<br />
yellow_cyl = [cgo.CYLINDER, *pos0, *pos1, r, *yellow, *yellow]<br />
cmd.load_cgo(yellow_cyl, "yellow_cylinder")<br />
<br />
# Magenta and green cone, open on one endray<br />
pos0 = [2, 2, 2]<br />
pos1 = [3, 3, 3]<br />
radii = [1, 0.5]<br />
color0 = [1, 0, 1]<br />
color1 = [0, 1, 0]<br />
caps = [0, 1]<br />
cone = [CONE] + pos0 + pos1 + radii + color0 + color1 + caps<br />
cmd.load_cgo(cone, "cone")<br />
</source></div>Jaredsampsonhttps://pymolwiki.org/index.php?title=CGO_Shapes&diff=13475CGO Shapes2022-02-14T02:04:30Z<p>Jaredsampson: Create page</p>
<hr />
<div>In PyMOL, a Compiled Graphics Object, or CGO, is a Python list of floating point numbers, which is compiled by PyMOL into a CGO object and associated with a given state. CGOs can be created in the PyMOL scene with the [[Load_CGO]] command.<br />
<br />
===CGO Commands===<br />
<br />
From an old version of the User Manual (and updated with current information):<br />
<br />
<pre><br />
Lowercase names below should be replaced with floating-point numbers. Generally, the TRIANGLE primitive should only be used only as a last restore since it is much less effective to render than using a series of vertices with a BEGIN/END group.<br />
<br />
BEGIN, { POINTS | LINES | LINE_LOOP | LINE_STRIP | TRIANGLES | TRIANGLE_STRIP | TRIANGLE_FAN },<br />
<br />
VERTEX, x, y, z,<br />
<br />
COLOR, red, green, blue, <br />
<br />
NORMAL, normal-x, normal-y, normal-z, <br />
<br />
END,<br />
<br />
LINEWIDTH, line-width, <br />
<br />
WIDTHSCALE, width-scale, # for ray-tracing<br />
<br />
SPHERE, x, y, z, radius # uses the current color<br />
<br />
CYLINDER, x1, y1, z1, x2, y2, z2, radius,<br />
red1, green1, blue1, red2, green2, blue2,<br />
<br />
TRIANGLE, x1, y1, z1, <br />
x2, y2, z2,<br />
x3, y3, z3,<br />
normal-x1, normal-y1, normal-z1,<br />
normal-x2, normal-y2, normal-z2,<br />
normal-x3, normal-y3, normal-z3,<br />
red1, green1, blue1, <br />
red2, green2, blue2, <br />
red3, green3, blue3, <br />
</pre></div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Load_CGO&diff=13474Load CGO2022-02-14T01:50:25Z<p>Jaredsampson: Create page</p>
<hr />
<div>'''cmd.load_cgo()''' loads Compiled Graphics Objects into the PyMOL session. CGOs are defined by lists of floating point numbers that define either a series of triangles/vertices and colors, or one of several predefined sequences that describe mathematical shapes.<br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.load_cgo(object, name)<br />
</source><br />
<br />
===ARGUMENTS===<br />
<br />
* '''object : list of floats''' Coordinate data for the CGO.<br />
* '''name : string''' Name of the object (for the internal GUI)<br />
<br />
===SEE ALSO===<br />
[[CGO Shapes]]<br />
<br />
<br />
[[Category:Commands|Load]]<br />
[[Category:States|Load]]<br />
[[Category:Input Output Module|Load]]<br />
[[Category:CGO]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13262Pml2020-03-25T19:46:41Z<p>Jaredsampson: /* Basic usage */ clarify about relative paths</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is <tt>.pml</tt>.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a <tt>.pml</tt> extension, e.g. <tt>script.pml</tt>.<br />
<br />
Run the script by either '''File > Run script...''' in the GUI menu bar, or via the command<br />
<br />
@/path/to/my/script.pml<br />
<br />
Relative paths are fine, so if PyMOL has been launched in the same directory as your script, you can simplify this to <code>@script.pml</code><br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of <code>fetch</code>, waiting to execute any following commands until the <code>fetch</code> command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
''PyMOL'' scripts can also contain ''Python'' code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
<source lang="python"><br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
</source><br />
<br />
Python code that spans more than one line can be enclosed in a <code>python/python end</code> code block, like this:<br />
<br />
<source lang="python"><br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
</source><br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13261Pml2020-03-25T19:45:14Z<p>Jaredsampson: /* PyMOL Script */ fix fixed-width formatting</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is <tt>.pml</tt>.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a <tt>.pml</tt> extension, e.g. <tt>script.pml</tt>.<br />
<br />
Run the script by either '''File > Run script...''' in the GUI menu bar, or via the command<br />
<br />
@/path/to/my/script.pml<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of <code>fetch</code>, waiting to execute any following commands until the <code>fetch</code> command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
''PyMOL'' scripts can also contain ''Python'' code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
<source lang="python"><br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
</source><br />
<br />
Python code that spans more than one line can be enclosed in a <code>python/python end</code> code block, like this:<br />
<br />
<source lang="python"><br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
</source><br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13260Pml2020-03-25T19:42:18Z<p>Jaredsampson: /* Basic usage */ fix fixed-width formatting</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a <tt>.pml</tt> extension, e.g. <tt>script.pml</tt>.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
<br />
@/path/to/my/script.pml<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
''PyMOL'' scripts can also contain ''Python'' code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
<source lang="python"><br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
</source><br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
<source lang="python"><br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
</source><br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13259Pml2020-03-25T19:40:29Z<p>Jaredsampson: /* Python code */ Italics</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml<br />
<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
''PyMOL'' scripts can also contain ''Python'' code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
<source lang="python"><br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
</source><br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
<source lang="python"><br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
</source><br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13258Pml2020-03-25T19:39:45Z<p>Jaredsampson: /* Python code */ add syntax highlighting</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml<br />
<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
PyMOL scripts can also contain *Python* code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
<source lang="python"><br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
</source><br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
<source lang="python"><br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
</source><br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Collada&diff=13257Collada2020-03-25T19:38:12Z<p>Jaredsampson: Create redirect</p>
<hr />
<div>#REDIRECT [[COLLADA]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13256Pml2020-03-25T19:34:16Z<p>Jaredsampson: /* Handy commands to include in your scripts */ add <code> tags</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml<br />
<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
PyMOL scripts can also contain *Python* code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
<br />
<br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* <code>reinitialize</code> - issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* <code>log_open log.pml</code> - create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* <code>deselect</code> - place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=PML&diff=13255PML2020-03-25T19:29:26Z<p>Jaredsampson: create redirect</p>
<hr />
<div>#REDIRECT [[Pml]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13254Pml2020-03-25T19:28:22Z<p>Jaredsampson: Jaredsampson moved page PML to Pml without leaving a redirect: Consistent with other page names</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml<br />
<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
PyMOL scripts can also contain *Python* code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
<br />
<br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* `reinitialize`: issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* `log_open log.pml`: create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* `deselect`: place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13253Pml2020-03-25T19:26:32Z<p>Jaredsampson: Add syntax and handy commands sections</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml<br />
<br />
<br />
=== Command syntax ===<br />
<br />
PyMOL commands are typically in the form:<br />
<br />
command arg1[, arg2[, ...]]<br />
<br />
For example:<br />
<br />
color green, chain A<br />
<br />
which will, as you might expect, color all the atoms of chain A green. There is no comma between the command and the first argument, and in general, no quotation marks are necessary around the arguments. (Exceptions to this rule include situations where you are passing a text string as an argument which contains a comma; in this case the entire string should be quoted.)<br />
<br />
For commands that take keyword arguments, the syntax is similar to passing keyword arguments to a Python function:<br />
<br />
fetch 1nmr, async=0<br />
<br />
will use the asynchronous version of fetch, waiting to execute any following commands until the `fetch` command finishes.<br />
<br />
<br />
==== Python code ====<br />
<br />
PyMOL scripts can also contain *Python* code. Single-line Python statements can be written normally and will be handled as expected;<br />
<br />
# imports<br />
import this<br />
from glob import glob<br />
<br />
# variable assignments<br />
prefix = "structure_"<br />
<br />
# complex single-line statements like list comprehensions<br />
[cmd.load(x) for x in glob(f'{prefix}*.pdb')]<br />
<br />
# any other arbitrary Python code<br />
print(2 + 2)<br />
<br />
Python code that spans more than one line can be enclosed in a `python` code block, like this:<br />
<br />
python<br />
def hello(name="World"):<br />
print("Hello,", name)<br />
python end<br />
<br />
<br />
<br />
=== Handy commands to include in your scripts ===<br />
<br />
* `reinitialize`: issue this command at the start of your script to allow it to be run multiple times in the same PyMOL session.<br />
* `log_open log.pml`: create a log file to record actions taken in the GUI. Examine this log file to learn new commands, although keep in mind that these are typically formatted as Python function calls.<br />
* `deselect`: place this at the very end of the script to ensure no atoms are selected after the script completes, for a cleaner GUI appearance.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13252Pml2020-03-25T16:49:43Z<p>Jaredsampson: /* PyMOL Script */</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing PyMOL commands, one per line, appearing as they would be entered at the PyMOL command prompt. The standard extension for a PyMOL script is `.pml`.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Pml&diff=13251Pml2020-03-25T16:48:22Z<p>Jaredsampson: Created page with basic description</p>
<hr />
<div><br />
== PyMOL Script ==<br />
<br />
PyMOL scripts are plain text files containing commands, one per line, appearing as they would be entered at the PyMOL command prompt.<br />
<br />
<br />
=== Basic usage ===<br />
<br />
Save your commands in a plain text file (using e.g. Notepad, TextEdit, or a text editor of your choice) with a `.pml` extension, e.g. `script.pml`.<br />
<br />
Run the script by either "File > Run script..." in the GUI menu bar, or via the command<br />
@/path/to/my/script.pml</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Running_Scripts&diff=13250Running Scripts2020-03-25T16:39:03Z<p>Jaredsampson: /* Python or Pymol? */ Add link to PML page</p>
<hr />
<div>This page is a short description for beginners on how to run scripts in PyMOL, e.g. from the [[:Category:Script_Library|Script Library]]. For help on writing scripts, look here: [[Simple_Scripting]], [[Advanced_Scripting]].<br />
<br />
== Saving the source code ==<br />
<br />
First, you have to save the source code. Copy the text in the box to a<br />
text editor and save it in text format under an arbitrary file name,<br />
let's say we save it as script.txt in the PyMOL working directory.<br />
<br />
== Python or Pymol? ==<br />
<br />
Then, you have to find out wheter the script you want to run is a<br />
python script or a PyMOL script. Look at the source code: if the lines<br />
look just as you type them in the command line in PyMOL, it is a [[PML|PyMOL<br />
script]]. Run it with @, in our example, type <br />
<br />
<source lang="python"><br />
@script.txt <br />
</source><br />
<br />
in the PyMOL command line. You can find examples in the script library: <br />
[[Split_Movement]] (loads a structure from the internet and moves parts in different directions), <br />
[[Show_charged]] (Selects charged residues and highlights them). <br />
Any PyMOL log file would also be an example for a pymol script.<br />
<br />
If, in contrast, you find words as "import" in one of the first lines,<br />
or "def" or "cmd" in the text body, you have a python script. Run it<br />
with run. In the example, type <br />
<br />
<source lang="python"><br />
run script.txt <br />
</source><br />
<br />
in the PyMOL command line. <br />
<br />
Most python scripts in the script library don't start action<br />
immediately but define a new command instead. You first have to run<br />
the script and then you can use the command. Many script pages provide<br />
hints for usage. If not, look at the bottom of the script for a line like this:<br />
<br />
<source lang="python"><br />
cmd.extend("new_command",new_command)<br />
</source><br />
<br />
The text in quotation marks is the new command. Enter it in the PyMOL command line.<br />
<br />
You can find many examples for python scripts in the script library, e.g.:<br />
[[Color_Objects]] (colors all the objects differently)<br />
[[Resicolor]] (Colors residues according to their property)<br />
<br />
== Python Modules ==<br />
<br />
A python '''module''' is a python script that runs in it's own namespace, by using the '''import''' syntax instead of '''run'''. The file must be located in any directory of the [http://docs.python.org/library/sys.html#sys.path sys.path] variable. This is the recommended way for scripts from the [[Git intro|Pymol-script-repo]].<br />
<br />
<source lang="python"><br />
import color_obj # skip the .py extension!<br />
</source><br />
<br />
== Example: Color_Objects ==<br />
<br />
<source lang="python"><br />
PyMOL>run color_obj.py<br />
PyMOL>color_obj <br />
<br />
Colouring objects using PyMOL defined colours<br />
<br />
obj_0001 red<br />
obj_0002 green<br />
obj_0003 blue<br />
obj_0004 yellow<br />
obj_0005 violet<br />
obj_0006 cyan<br />
obj_0007 salmon<br />
obj_0008 lime<br />
obj_0009 pink<br />
obj_0010 slate<br />
obj_0011 magenta<br />
obj_0012 orange<br />
obj_0013 marine<br />
obj_0014 olive<br />
...<br />
</source><br />
<br />
[[Category:Tutorials]]<br />
[[Category:Scripting]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Set_Color&diff=13184Set Color2019-10-02T17:38:15Z<p>Jaredsampson: Add link to missing set_object_color command page</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 />
* [[set_object_color]]<br />
<br />
[[Category:Commands|Set Color]]<br />
[[Category:Coloring|Set Color]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=File:4gms_colors.png&diff=12840File:4gms colors.png2018-12-06T04:07:14Z<p>Jaredsampson: formatting for script</p>
<hr />
<div>Prepared in response to a pymol-users thread from 11/30/2018-12/5/2018 about the appearance of transparency in a published figure.<br />
<br />
Script to reproduce:<br />
<br />
bg_color white<br />
fetch 4gms, async=0<br />
<br />
# hemagglutinin selections<br />
select ha, chain A<br />
select l130, ha and resi 133-138<br />
select l150, ha and resi 155-163<br />
select h190, ha and resi 187-196<br />
select l220, ha and resi 225-228<br />
select loops, l130 or l150 or h190 or l220<br />
<br />
# antibody selection<br />
select h2, chain H and resi 51-59<br />
deselect<br />
<br />
# basic view<br />
hide everything<br />
as cartoon, ha<br />
as cartoon, h2<br />
cartoon tube<br />
<br />
# colors<br />
color orange, h2<br />
color palecyan, ha<br />
color deepteal, loops<br />
<br />
set_view (\<br />
-0.718157351, 0.514449000, -0.468602538,\<br />
-0.667115033, -0.317360103, 0.673974276,\<br />
0.198008969, 0.796632588, 0.571111977,\<br />
0.000045628, -0.000060942, -75.169761658,\<br />
20.388980865, -23.567779541, 38.543788910,\<br />
52.026283264, 98.326217651, -20.000000000 )<br />
<br />
set ray_opaque_background, 1<br />
png 4gms_colors.png, height=800, width=800, ray=1</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=File:4gms_colors.png&diff=12839File:4gms colors.png2018-12-06T04:04:52Z<p>Jaredsampson: Prepared in response to a pymol-users thread from 11/30/2018-12/5/2018 about the appearance of transparency in a published figure.
Script to reproduce:
bg_color white
fetch 4gms, async=0
# hemagglutinin selections
select ha, chain A
select l130, ha...</p>
<hr />
<div>Prepared in response to a pymol-users thread from 11/30/2018-12/5/2018 about the appearance of transparency in a published figure.<br />
<br />
Script to reproduce:<br />
<br />
bg_color white<br />
fetch 4gms, async=0<br />
<br />
# hemagglutinin selections<br />
select ha, chain A<br />
select l130, ha and resi 133-138<br />
select l150, ha and resi 155-163<br />
select h190, ha and resi 187-196<br />
select l220, ha and resi 225-228<br />
select loops, l130 or l150 or h190 or l220<br />
<br />
# antibody selection<br />
select h2, chain H and resi 51-59<br />
deselect<br />
<br />
# basic view<br />
hide everything<br />
as cartoon, ha<br />
as cartoon, h2<br />
cartoon tube<br />
<br />
# colors<br />
color orange, h2<br />
color palecyan, ha<br />
color deepteal, loops<br />
<br />
set_view (\<br />
-0.718157351, 0.514449000, -0.468602538,\<br />
-0.667115033, -0.317360103, 0.673974276,\<br />
0.198008969, 0.796632588, 0.571111977,\<br />
0.000045628, -0.000060942, -75.169761658,\<br />
20.388980865, -23.567779541, 38.543788910,\<br />
52.026283264, 98.326217651, -20.000000000 )<br />
<br />
set ray_opaque_background, 1<br />
png 4gms_colors.png, height=800, width=800, ray=1</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Talk:MAC_Install&diff=12801Talk:MAC Install2018-10-08T17:15:11Z<p>Jaredsampson: /* Package managers */ new section</p>
<hr />
<div>This needs a contribution from someone with experience with stereo on a mac. I have none.<br />
<br />
== Package managers ==<br />
<br />
Does anyone still use Fink or MacPorts for PyMOL? Just curious. I don't hear about them much anymore (but admittedly this may be confirmation bias). -Jared</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=MAC_Install&diff=12800MAC Install2018-10-08T17:05:05Z<p>Jaredsampson: /* Pre-compiled */ Make Homebrew the recommended package manager</p>
<hr />
<div>This page describes how to install PyMOL on Mac OS X.<br />
<br />
== Incentive PyMOL ==<br />
<br />
[http://www.schrodinger.com Schrödinger] provides pre-compiled PyMOL to paying sponsors. The bundle also includes ready-to-use [[APBS]], [[morph|RigiMOL]], an MPEG encoder for movie export, and a small molecule energy minimization engine.<br />
<br />
Download: https://pymol.org/<br />
<br />
Installation: Drag '''PyMOL.app''' on the '''/Applications''' shortcut. (In principle, you could drag it into any Finder window and run it from there, it doesn’t have to live in /Applications).<br />
<br />
Uninstallation: Move '''/Applications/PyMOL.app''' to Trash<br />
<br />
=== Launching from Command Line ===<br />
<br />
The unix executable resides at '''/Applications/PyMOL.app/Contents/MacOS/PyMOL'''<br />
<br />
=== X11 Hybrid ===<br />
<br />
''Applies to PyMOL 1.x, not to PyMOL 2.x''<br />
<br />
MacPyMOL can optionally run with the same two-window GUI which PyMOL uses on Windows and Linux. This GUI has some additional features, like the [[Plugins|Plugin]] menu and the [[Builder]].<br />
<br />
Requires [http://xquartz.macosforge.org/ XQuartz].<br />
<br />
There are two ways to launch the X11 interface:<br />
# Rename or copy/duplicate '''/Applications/MacPyMOL.app''' to '''/Applications/MacPyMOLX11Hybrid.app''' or to '''/Applications/PyMOLX11Hybrid.app'''<br />
# Launch the unix executable with the '''-m''' flag: '''/Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL -m'''<br />
<br />
=== Stereo on Second Monitor ===<br />
The trick to getting MacPyMOL to work in stereo on the second monitor is to force it to initially open on that display by providing an appropriate "-X #" (and perhaps -Y #) option on launch. That way the OpenGL context will be created with stereo support.<br />
<source lang="python"><br />
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000<br />
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000 -Y 100<br />
</source><br />
<br />
'''Source:''' [https://sourceforge.net/p/pymol/mailman/message/11671952/ Warren DeLano; PyMOL Users Archive]<br />
<br />
== Open-Source PyMOL ==<br />
<br />
=== Package managers ===<br />
<br />
Open-Source PyMOL is available [https://github.com/schrodinger/pymol-open-source/blob/master/LICENSE free of charge] and may be readily installed via the [http://brew.sh/ Homebrew] (recommended), [https://www.macports.org/ MacPorts], or [http://www.finkproject.org/ Fink] package managers.<br />
<br />
<source lang="bash"><br />
# Homebrew (recommended)<br />
brew install brewsci/bio/pymol<br />
<br />
# Fink<br />
fink install pymol-py27<br />
<br />
# MacPorts<br />
sudo port install pymol<br />
</source><br />
<br />
You may need to make sure that the dependencies are installed with the required flags, e.g. for MacPorts:<br />
<br />
<source lang="bash"><br />
# MacPorts<br />
sudo port install tcl -corefoundation<br />
sudo port install tk -quartz<br />
</source><br />
<br />
If PyMOL complains that it wasn't able to find X11, try starting xquartz first, then run pymol from the console.<br />
<br />
=== Install from Source ===<br />
<br />
If you want the latest PyMOL code (warning: might include experimental changes), then follow the [[Linux_Install#Install_from_source|Linux installation instructions]]. You will need an environment like Fink, MacPorts or Homebrew to install the dependencies. Make sure you use the appropriate python interpreter (e.g. '''/sw/bin/python2.7''' when using Fink).<br />
<br />
To run PyMOL with a native PyQt library (linked against macOS OpenGL framework, not against XQuartz), it needs to be built with the <code>--osx-frameworks</code> option:<br />
<br />
<source lang="bash"><br />
python setup.py --osx-frameworks install<br />
</source><br />
<br />
=== Install APBS with Fink ===<br />
<br />
To use the electrostatics plugin, you will need [http://apbs.sourceforge.net/ APBS] and its dependencies. These are also available as Fink packages, and include [http://pdb.finkproject.org/pdb/package.php/apbs APBS], [http://pdb.finkproject.org/pdb/package.php/maloc maloc] and [http://pdb.finkproject.org/pdb/package.php/pdb2pqr pdb2pqr]. If you have multiple processors available, you might wish to install the [http://pdb.finkproject.org/pdb/package.php/apbs-mpi-openmpi MPI version of APBS].<br />
<br />
Issuing the command<br />
<br />
fink install apbs<br />
<br />
will install apbs and its required dependencies for you. The fink pymol package is already preconfigured to do the right thing to use apbs as a plugin.<br />
<br />
=== Stereo issues ===<br />
Some older Macs seem to crash with stereo graphics. If this happens to you, a workaround is to launch PyMOL explicitly in Mono mode with `pymol -M`. You can also set up an alias in your ~/.profile:<br />
<br />
alias pymol='pymol -M'<br />
<br />
== See Also ==<br />
<br />
* [[pymolrc]]<br />
* [[Linux Install]]<br />
* [[Windows Install]]<br />
* [[MovieSchool_6#Exporting_your_Movie|FreeMOL installation for MPEG movie export]]<br />
* [[User:Wgscott|Bill Scott’s]] [[MacOSX-specific .pymolrc file]] and his crystallographic software [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Main_Page wiki] and [http://chemistry.ucsc.edu/~wgscott/xtal/ website], including instructions on [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Getting_your_fink_installation_to_use_packages_that_I_have_pre-compiled how to install precompiled binary packages using fink].<br />
* [[Launching_PyMOL#MacOS_X]]<br />
<br />
[[Category:Installation|Mac]]<br />
[[Category:Nucleic_Acids|MAC Install]]<br />
[[Category:Technical Issues|MAC Install]]<br />
[[Category:Mac|MAC Install]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=MAC_Install&diff=12799MAC Install2018-10-08T17:01:48Z<p>Jaredsampson: /* Pre-compiled */ Update Homebrew info to reflect new location of PyMOL formula and no more need for flags in dependencies.</p>
<hr />
<div>This page describes how to install PyMOL on Mac OS X.<br />
<br />
== Incentive PyMOL ==<br />
<br />
[http://www.schrodinger.com Schrödinger] provides pre-compiled PyMOL to paying sponsors. The bundle also includes ready-to-use [[APBS]], [[morph|RigiMOL]], an MPEG encoder for movie export, and a small molecule energy minimization engine.<br />
<br />
Download: https://pymol.org/<br />
<br />
Installation: Drag '''PyMOL.app''' on the '''/Applications''' shortcut. (In principle, you could drag it into any Finder window and run it from there, it doesn’t have to live in /Applications).<br />
<br />
Uninstallation: Move '''/Applications/PyMOL.app''' to Trash<br />
<br />
=== Launching from Command Line ===<br />
<br />
The unix executable resides at '''/Applications/PyMOL.app/Contents/MacOS/PyMOL'''<br />
<br />
=== X11 Hybrid ===<br />
<br />
''Applies to PyMOL 1.x, not to PyMOL 2.x''<br />
<br />
MacPyMOL can optionally run with the same two-window GUI which PyMOL uses on Windows and Linux. This GUI has some additional features, like the [[Plugins|Plugin]] menu and the [[Builder]].<br />
<br />
Requires [http://xquartz.macosforge.org/ XQuartz].<br />
<br />
There are two ways to launch the X11 interface:<br />
# Rename or copy/duplicate '''/Applications/MacPyMOL.app''' to '''/Applications/MacPyMOLX11Hybrid.app''' or to '''/Applications/PyMOLX11Hybrid.app'''<br />
# Launch the unix executable with the '''-m''' flag: '''/Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL -m'''<br />
<br />
=== Stereo on Second Monitor ===<br />
The trick to getting MacPyMOL to work in stereo on the second monitor is to force it to initially open on that display by providing an appropriate "-X #" (and perhaps -Y #) option on launch. That way the OpenGL context will be created with stereo support.<br />
<source lang="python"><br />
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000<br />
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000 -Y 100<br />
</source><br />
<br />
'''Source:''' [https://sourceforge.net/p/pymol/mailman/message/11671952/ Warren DeLano; PyMOL Users Archive]<br />
<br />
== Open-Source PyMOL ==<br />
<br />
=== Pre-compiled ===<br />
<br />
Pre-compiled Open-Source PyMOL is available [https://github.com/schrodinger/pymol-open-source/blob/master/LICENSE free of charge] with the [https://www.macports.org/ MacPorts], [http://www.finkproject.org/ Fink] and [http://brew.sh/ Homebrew] environments.<br />
<br />
<source lang="bash"><br />
# Fink<br />
fink install pymol-py27<br />
<br />
# MacPorts<br />
sudo port install pymol<br />
<br />
# Homebrew<br />
brew install brewsci/bio/pymol<br />
</source><br />
<br />
You may need to make sure that the dependencies are installed with the required flags, e.g. for MacPorts:<br />
<br />
<source lang="bash"><br />
# MacPorts<br />
sudo port install tcl -corefoundation<br />
sudo port install tk -quartz<br />
</source><br />
<br />
If PyMOL complains that it wasn't able to find X11, try starting xquartz first, then run pymol from the console.<br />
<br />
=== Install from Source ===<br />
<br />
If you want the latest PyMOL code (warning: might include experimental changes), then follow the [[Linux_Install#Install_from_source|Linux installation instructions]]. You will need an environment like Fink, MacPorts or Homebrew to install the dependencies. Make sure you use the appropriate python interpreter (e.g. '''/sw/bin/python2.7''' when using Fink).<br />
<br />
To run PyMOL with a native PyQt library (linked against macOS OpenGL framework, not against XQuartz), it needs to be built with the <code>--osx-frameworks</code> option:<br />
<br />
<source lang="bash"><br />
python setup.py --osx-frameworks install<br />
</source><br />
<br />
=== Install APBS with Fink ===<br />
<br />
To use the electrostatics plugin, you will need [http://apbs.sourceforge.net/ APBS] and its dependencies. These are also available as Fink packages, and include [http://pdb.finkproject.org/pdb/package.php/apbs APBS], [http://pdb.finkproject.org/pdb/package.php/maloc maloc] and [http://pdb.finkproject.org/pdb/package.php/pdb2pqr pdb2pqr]. If you have multiple processors available, you might wish to install the [http://pdb.finkproject.org/pdb/package.php/apbs-mpi-openmpi MPI version of APBS].<br />
<br />
Issuing the command<br />
<br />
fink install apbs<br />
<br />
will install apbs and its required dependencies for you. The fink pymol package is already preconfigured to do the right thing to use apbs as a plugin.<br />
<br />
=== Stereo issues ===<br />
Some older Macs seem to crash with stereo graphics. If this happens to you, a workaround is to launch PyMOL explicitly in Mono mode with `pymol -M`. You can also set up an alias in your ~/.profile:<br />
<br />
alias pymol='pymol -M'<br />
<br />
== See Also ==<br />
<br />
* [[pymolrc]]<br />
* [[Linux Install]]<br />
* [[Windows Install]]<br />
* [[MovieSchool_6#Exporting_your_Movie|FreeMOL installation for MPEG movie export]]<br />
* [[User:Wgscott|Bill Scott’s]] [[MacOSX-specific .pymolrc file]] and his crystallographic software [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Main_Page wiki] and [http://chemistry.ucsc.edu/~wgscott/xtal/ website], including instructions on [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Getting_your_fink_installation_to_use_packages_that_I_have_pre-compiled how to install precompiled binary packages using fink].<br />
* [[Launching_PyMOL#MacOS_X]]<br />
<br />
[[Category:Installation|Mac]]<br />
[[Category:Nucleic_Acids|MAC Install]]<br />
[[Category:Technical Issues|MAC Install]]<br />
[[Category:Mac|MAC Install]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Isomesh&diff=12734Isomesh2018-03-08T17:19:21Z<p>Jaredsampson: /* USAGE */ add units for "level" parameter</p>
<hr />
<div>'''isomesh''' creates a mesh isosurface object from a map object.<br />
<br />
===USAGE===<br />
isomesh name, map, level [,(selection) [,buffer [,state [,carve ]]]] <br />
<br />
*name = the name for the new mesh isosurface object.<br />
*map = the name of the map object to use for computing the mesh.<br />
*level = the contour level (in sigma units)<br />
*selection = an atom selection about which to display the mesh with an additional "buffer" (if provided).<br />
*state = the state into which the object should be loaded (default=1) (set state=0 to append new mesh as a new state)<br />
*carve = a radius about each atom in the selection for which to include density. If "carve" is not provided, then the whole brick is displayed.<br />
<br />
=== Examples ===<br />
<source lang="python"><br />
# load the map<br />
load mymap.xplor, themap<br />
# view the isomesh map<br />
isomesh themapobject, themap, 2.0, site, carve=1.6<br />
</source><br />
[[Image:Isomesh_ex1.png|thumb|right|300px|Output from the 2nd example]]<br />
<source lang="python"><br />
# create fake map for demo<br />
load $TUT/1hpv.pdb<br />
<br />
# set b and q for all atoms<br />
alter all, b=10<br />
alter all, q=1<br />
<br />
# make a new map<br />
map_new fake_map, gaussian, 0.5, all<br />
<br />
# carved brick<br />
isomesh carved, fake_map, 1.0, resi 200, carve=2.1<br />
<br />
color marine, carved<br />
<br />
# normal brick<br />
isomesh normal, fake_map, 1.0, resi 200, 2.1<br />
<br />
orient resi 200<br />
</source><br />
<br />
===NOTES===<br />
====USAGE====<br />
If the mesh object already exists, then the new mesh will be appended onto the object as a new state (unless you indicate a state).<br />
<br />
*state > 0: specific state<br />
*state = 0: all states<br />
*state = -1: current state<br />
<br />
*source_state > 0: specific state<br />
*source_state = 0: include all states starting with 0<br />
*source_state = -1: current state<br />
*source_state = -2: last state in map<br />
<br />
====MAP AROUND THE CENTER====<br />
<br />
You can create mesh around the center of the view by specifying "center" as the selection argument.<br />
<br />
<source lang="python"><br />
isomesh normal, fake_map, 1.0, center<br />
</source><br />
<br />
====MAP OUTSIDE THE CALCULATED AREA====<br />
<br />
When [[map_auto_expand_sym]] is ON, you can create mesh beyond the precalculated volume. In this<br />
case, symmetry information (lattice constants, space group) of the model specified in the selection <br />
argument if available, or (new in 1.7) from the map object.<br />
<br />
====MAP LEVELS====<br />
* Generally speaking there is some ambiguity with visualization tools as to how map data is to treated: Some map file formats are normalized by convention (in the file data itself) and others do not. Some visualization tools automatically normalize maps upon reading, others do not. PyMOL's default behavior is dependent upon map file type: CCP4 and O/BRIX/DSN6 maps are automatically normalized upon reading (disable via '''normalize_*''' settings), other maps types are not. PyMOL's normalization is a straight statistical average of all map points -- this may or may not be what you want. If migrating to PyMOL from another tool, then it is definitely worth comparing how the maps are being represented by creating an equivalent figure in both, making sure that they match, and if they do not, then figuring out why not. ''From the PyMOL list. Author: Warren DeLano.''<br />
<br />
===SEE ALSO===<br />
*[[isodot]]<br />
*[[load]]<br />
*[[fetch]]<br />
*[[dynamic_mesh]]<br />
<br />
[[Category:Commands|Isomesh]]<br />
[[Category:States|Isomesh]]<br />
[[Category:Electron_Density]]<br />
[[Category:Maps]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12680Colorblindfriendly2017-11-15T19:21:03Z<p>Jaredsampson: /* Download the script and run locally */ Add a "run from Github" example.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
=== Import as a module ===<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <code>cb_colors</code> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module, call the <code>set_colors()</code> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
<br />
# Add the new colors<br />
cbf.set_colors()<br />
color cb_red, myObject<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<code>cb_</code>" prefix.). Do this by passing the <code>replace</code> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color yellow, myOtherObject # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <code>cb_colors</code> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <code>grays</code> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a `cb_colors` menu to the OpenGL GUI (see screenshot)<br />
# This will also add the colors if `set_colors()` hasn't yet been run.<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
=== Run the latest version of the script from Github ===<br />
<br />
In a PyMOL session, run at the command line:<br />
<br />
run https://github.com/Pymol-Scripts/Pymol-script-repo/raw/master/colorblindfriendly.py<br />
<br />
This will add all the colors as well as the OpenGL menu.<br />
<br />
<br />
=== Download the script and run locally ===<br />
<br />
Save the script from the link in the box at the top right to your computer.<br />
<br />
In a PyMOL session, run at the command line:<br />
<br />
run /path/to/colorblindfriendly.py<br />
<br />
This will add all the colors as well as the OpenGL menu.<br />
<br />
== Requirements ==<br />
The <tt>cb_colors</tt> GUI menu (generated by the <tt>add_menu()</tt> function) requires PyMOL 1.6.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12675Colorblindfriendly2017-10-26T20:08:59Z<p>Jaredsampson: /* Usage */ Add instructions for running as dowloaded script.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
=== Import as a module ===<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <code>cb_colors</code> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module, call the <code>set_colors()</code> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
<br />
# Add the new colors<br />
cbf.set_colors()<br />
color cb_red, myObject<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<code>cb_</code>" prefix.). Do this by passing the <code>replace</code> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color yellow, myOtherObject # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <code>cb_colors</code> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <code>grays</code> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a `cb_colors` menu to the OpenGL GUI (see screenshot)<br />
# This will also add the colors if `set_colors()` hasn't yet been run.<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
=== Download the script and run locally ===<br />
<br />
Save the script from the link in the box at the top right to your computer.<br />
<br />
In a PyMOL session, run at the command line:<br />
<br />
run /path/to/colorblindfriendly.py<br />
<br />
This will add all the colors as well as the OpenGL menu.<br />
<br />
== Requirements ==<br />
The <tt>cb_colors</tt> GUI menu (generated by the <tt>add_menu()</tt> function) requires PyMOL 1.6.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12674Colorblindfriendly2017-10-26T19:50:19Z<p>Jaredsampson: /* Usage */ update code samples and use <code> instead of <tt> tags.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <code>cb_colors</code> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module, call the <code>set_colors()</code> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
<br />
# Add the new colors<br />
cbf.set_colors()<br />
color cb_red, myObject<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<code>cb_</code>" prefix.). Do this by passing the <code>replace</code> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color yellow, myOtherObject # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <code>cb_colors</code> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <code>grays</code> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a `cb_colors` menu to the OpenGL GUI (see screenshot)<br />
# This will also add the colors if `set_colors()` hasn't yet been run.<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
== Requirements ==<br />
The <tt>cb_colors</tt> GUI menu (generated by the <tt>add_menu()</tt> function) requires PyMOL 1.6.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12672Colorblindfriendly2017-10-26T13:51:08Z<p>Jaredsampson: /* Requirements */ update to reflect support for older PyMOLs</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <tt>cb_colors</tt> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module,<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
</syntaxhighlight><br />
<br />
call the <tt>set_colors()</tt> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add the new colors<br />
cbf.set_colors()<br />
color myObject, cb_red<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<tt>cb_</tt>" prefix.). Do this by passing the <tt>replace</tt> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color myOtherObject, yellow # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <tt>cb_colors</tt> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <tt>grays</tt> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a cb_colors menu item to the OpenGL GUI ([C] menu in the right panel)<br />
# this also adds the colors<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
== Requirements ==<br />
The <tt>cb_colors</tt> GUI menu (generated by the <tt>add_menu()</tt> function) requires PyMOL 1.6.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12671Colorblindfriendly2017-10-26T04:42:54Z<p>Jaredsampson: /* Usage */ fix object name for consistency</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <tt>cb_colors</tt> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module,<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
</syntaxhighlight><br />
<br />
call the <tt>set_colors()</tt> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add the new colors<br />
cbf.set_colors()<br />
color myObject, cb_red<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<tt>cb_</tt>" prefix.). Do this by passing the <tt>replace</tt> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color myOtherObject, yellow # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <tt>cb_colors</tt> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <tt>grays</tt> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a cb_colors menu item to the OpenGL GUI ([C] menu in the right panel)<br />
# this also adds the colors<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
== Requirements ==<br />
The <tt>add_menu()</tt> function and OpenGL <tt>cb_colors</tt> menu currently only works with PyMOL 2.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12670Colorblindfriendly2017-10-26T04:41:20Z<p>Jaredsampson: /* Usage */ Update usage for version 0.2; Add requirements section.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
<br />
[[File:colorblindfriendly_menu.png|thumb|Screenshot of the <tt>cb_colors</tt> color menu in the OpenGL GUI in PyMOL 2.0.]]<br />
<br />
After importing the module,<br />
<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly as cbf<br />
</syntaxhighlight><br />
<br />
call the <tt>set_colors()</tt> function to add the colors to PyMOL's color palette. Then, use these color names just like any other named color, using the <code>[[color]]</code> command.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add the new colors<br />
cbf.set_colors()<br />
color myObject, cb_red<br />
</syntaxhighlight><br />
<br />
The colors can also be made to replace the built-in colors (i.e. they are created both with and without the "<tt>cb_</tt>" prefix.). Do this by passing the <tt>replace</tt> keyword argument.<br />
<br />
<syntaxhighlight lang="python"><br />
# Replace built-in colors with cbf ones<br />
cbf.set_colors(replace=True)<br />
color my_other_object, yellow # actually cb_yellow<br />
</syntaxhighlight><br />
<br />
One can also add an entry to the color menu in the right-side OpenGL GUI. So clicking on [C], there will now be a <tt>cb_colors</tt> menu item, which expands to give all the color blind-friendly colors, except black, which is available in the <tt>grays</tt> menu.<br />
<br />
<syntaxhighlight lang="python"><br />
# Add a cb_colors menu item to the OpenGL GUI ([C] menu in the right panel)<br />
# this also adds the colors<br />
cbf.add_menu()<br />
</syntaxhighlight><br />
<br />
== Requirements ==<br />
The <tt>add_menu()</tt> function and OpenGL <tt>cb_colors</tt> menu currently only works with PyMOL 2.0 and later.<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=File:Colorblindfriendly_menu.png&diff=12669File:Colorblindfriendly menu.png2017-10-26T04:17:31Z<p>Jaredsampson: Screenshot of the color list menu added to the OpenGL GUI by the colorblindfriendly.py script in PyMOL 2.0.</p>
<hr />
<div>Screenshot of the color list menu added to the OpenGL GUI by the colorblindfriendly.py script in PyMOL 2.0.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Colorblindfriendly&diff=12668Colorblindfriendly2017-10-26T04:04:34Z<p>Jaredsampson: /* Colors */ show 0-255 values instead.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = script<br />
|filename = colorblindfriendly.py<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
<br />
<br />
== Introduction ==<br />
Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better not used in figures intended for public viewing.<br />
<br />
This script generates a palette of named colors for PyMOL that are unambiguous both to colorblind and non-colorblind individuals.<br />
<br />
The colors listed here are defined according to recommendations found at [http://jfly.iam.u-tokyo.ac.jp/html/color_blind/#pallet J*FLY]. This website is a good reference to consult when making all kinds of figures, not just those made using PyMOL.<br />
<br />
<br />
== Colors ==<br />
These are the 0-255 RGB values from the J*FLY page that are used in the script, with the defined color names and alternate names.<br />
{| cellpadding="1"<br />
|- align="center"<br />
! width="20"|&nbsp;||bgcolor=#ddd width="100"|name||bgcolor=#ddd width="50"|R||bgcolor=#ddd width="50"|G||bgcolor=#ddd width="50"|B||bgcolor=#ddd|alternate names<br />
|- align="center"<br />
|bgcolor="#000000"|&nbsp;||cb_black||0||0||0||<br />
|- align="center"<br />
|bgcolor="#e69f00"|&nbsp;||cb_orange||230||159||0||<br />
|- align="center"<br />
|bgcolor="#56b4e9"|&nbsp;||cb_sky_blue||86||180||233||cb_skyblue, cb_light_blue, cb_lightblue<br />
|- align="center"<br />
|bgcolor="#009e73"|&nbsp;||cb_bluish_green||0||158||115||cb_bluishgreen, cb_green<br />
|- align="center"<br />
|bgcolor="#f0e442"|&nbsp;||cb_yellow||240||228||66||<br />
|- align="center"<br />
|bgcolor="#0072b2"|&nbsp;||cb_blue||0||114||178||<br />
|- align="center"<br />
|bgcolor="#d55e00"|&nbsp;||cb_vermillion||213||94||0||cb_red, cb_red_orange, cb_redorange<br />
|- align="center"<br />
|bgcolor="#cc79a7"|&nbsp;||cb_reddish_purple||204||121||167||cb_rose, cb_violet, cb_magenta<br />
|}<br />
<br />
== Usage ==<br />
Use these color names just like any other named color, using the <code>[[color]]</code> command:<br />
<syntaxhighlight lang="python"><br />
import colorblindfriendly<br />
color cb_skyblue, all<br />
</syntaxhighlight><br />
<br />
<br />
<br />
[[Category:Coloring]]<br />
[[Category:Script_Library]]<br />
[[Category:Structural_Biology_Scripts]]<br />
[[Category:Pymol-script-repo]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Get_Color_Indices&diff=12666Get Color Indices2017-10-26T02:25:12Z<p>Jaredsampson: add reference to Get_color_index</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]]. To retrieve a single index for a specific color name, use '''[[get_color_index]]''' instead.<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_index]]<br />
* [[Get_Color_Tuples]]<br />
* [[Iterate]]<br />
<br />
[[Category:Commands|Get Color Indices]]<br />
[[Category:Coloring|Get Color Indices]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Get_color_index&diff=12665Get color index2017-10-26T02:23:21Z<p>Jaredsampson: Add See Also and Categories</p>
<hr />
<div>'''get_color_index''' in combination with '''get_color_tuple''' will retrieve the RGB values for a single color.<br />
<br />
<source><br />
PyMOL>print cmd.get_color_index('black')<br />
1<br />
PyMOL>print cmd.get_color_tuple(1)<br />
(0.0, 0.0, 0.0)<br />
</source><br />
<br />
<br />
== See Also ==<br />
* [[Get_Color_Indices]]<br />
* [[Get_Color_Tuples]]<br />
<br />
[[Category:Commands|Get color index]]<br />
[[Category:Coloring|Get color index]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Get_color_index&diff=12664Get color index2017-10-26T02:21:28Z<p>Jaredsampson: Create page</p>
<hr />
<div>'''get_color_index''' in combination with '''get_color_tuple''' will retrieve the RGB values for a single color.<br />
<br />
<source><br />
PyMOL>print cmd.get_color_index('black')<br />
1<br />
PyMOL>print cmd.get_color_tuple(1)<br />
(0.0, 0.0, 0.0)<br />
</source></div>Jaredsampsonhttps://pymolwiki.org/index.php?title=Selection_Algebra&diff=12620Selection Algebra2017-07-29T00:26:48Z<p>Jaredsampson: /* Selection Operator/Modifier Table */ fix vertical line display for "or" operator</p>
<hr />
<div>__FORCETOC__<br />
<br />
Selections can be made more precise or inclusive by combining them with logical operators, including the boolean '''and''', '''or''', and '''not'''. The boolean '''and''' selects only those items that have both (or all) of the named properties, and the boolean '''or''' selects items that have either (or any) of them. Venn diagrams show that '''and ''' selects the areas of overlap, while '''or''' selects both areas. <br />
<br />
See [http://pymol.sourceforge.net/newman/user/S0220venn.jpg simple logic Venn diagram].<br />
<br />
== Selection Operator/Modifier Table ==<br />
Selection operators and modifiers are listed below. The dummy variables ''s1'' and ''s2'' stand for selection-expressions such as "chain a" or "hydro."<br />
<br />
{| border=1 cellpadding=10<br />
|-<br />
! Operator<br />
! Short Form<br />
! Effect<br />
<br />
|-<br />
| not ''s''1<br />
| !''s''1<br />
| Selects atoms that are not included in ''s''1. <br />
<pre>PyMOL> select sidechains, ! bb</pre><br />
<br />
|-<br />
| ''s''1 and ''s''2<br />
| ''s''1 &amp; ''s''2<br />
| Selects atoms included in both ''s''1 and ''s''2. <br />
<pre>PyMOL> select far_bb, bb &amp;farfrm_ten</pre><br />
<br />
|-<br />
| ''s''1 or ''s''2<br />
| ''s''1 &#124; ''s''2<br />
| Selects atoms included in either ''s''1 or ''s''2. <br />
<pre>PyMOL> select all_prot, bb | sidechain</pre><br />
<br />
|-<br />
| ''s''1 in ''s''2<br />
| ''s''1 in ''s''2<br />
|Selects atoms in ''s''1 whose identifiers name, resi, resn, chain and segi <u>'''all'''</u> match atoms in ''s''2.<br />
<pre>PyMOL> select same_atms, pept in prot</pre><br />
<br />
|-<br />
| ''s''1 like ''s''2<br />
| ''s''1 l. ''s''2<br />
| Selects atoms in ''s''1 whose identifiers name and resi match atoms in ''s''2.<br />
<pre>PyMOL> select similar_atms, pept like prot</pre><br />
<br />
|-<br />
| ''s''1 gap ''X''<br />
|<br />
|Selects all atoms whose van der Waals radii are separated from the van der Waals radii of ''s''1 by a minimum of'' X'' Angstroms.<br />
<pre>PyMOL> select farfrm_ten, resi 10 gap 5</pre><br />
<br />
|-<br />
| ''s''1 around ''X''<br />
| ''s''1 a. ''X''<br />
|Selects atoms with centers within'' X'' Angstroms of the center of any atom in''s''1.<br />
<pre>PyMOL> select near_ten, resi 10 around 5</pre><br />
<br />
|-<br />
| ''s''1 expand ''X''<br />
| ''s''1 x. ''X''<br />
|Expands ''s''1 by all atoms within ''X'' Angstroms of the center of any atom in ''s''1.<br />
<pre>PyMOL> select near_ten_x, near_ten expand 3</pre><br />
<br />
|-<br />
| ''s''1 within ''X'' of ''s''2<br />
| ''s''1 w. ''X'' of ''s''2<br />
| Selects atoms in ''s''1 that are within ''X'' Angstroms of any atom in ''s''2.<br />
<pre>PyMOL> select bbnearten, bb w. 4 of resi 10</pre><br />
<br />
|-<br />
| ''s''1 near_to ''X'' of ''s''2<br />
| ''s''1 nto. ''X'' of ''s''2<br />
| Same as ''within'', but excludes ''s''2 from the selection (and thus is identical to <code>s1 and ''s2'' around X</code>).<br />
<br />
|-<br />
| ''s''1 beyond ''X'' of ''s''2<br />
| ''s''1 be. ''X'' of ''s''2<br />
| Selects atoms in ''s1'' that are at least ''X'' Anstroms away from ''s2''.<br />
<br />
|-<br />
| byres ''s''1<br />
| br. ''s''1<br />
| Expands selection to complete residues.<br />
<pre>PyMOL> select complete_res, br. bbnear10</pre><br />
<br />
|-<br />
| bymolecule ''s''1<br />
| bm. ''s''1<br />
| Expands selection to complete molecules.<br />
<pre>PyMOL> select complete_mol, bm. bbnear10</pre><br />
<br />
|-<br />
| byfragment ''s''1<br />
| bf. ''s''1<br />
| Expands selection to complete fragments.<br />
<pre>PyMOL> select complete_frag, bf. bbnear10</pre><br />
<br />
|-<br />
| bysegment ''s''1<br />
| bs. ''s''1<br />
| Expands selection to complete segments.<br />
<pre>PyMOL> select complete_seg, bs. bbnear10</pre><br />
<br />
|-<br />
| byobject ''s''1<br />
| bo. ''s''1<br />
| Expands selection to complete objects.<br />
<pre>PyMOL> select near_obj, bo. near_res</pre><br />
<br />
|-<br />
| bycell ''s''1<br />
| <br />
| Expands selection to unit cell.<br />
<pre>PyMOL> select complete_cell, bycell orig_res</pre><br />
<br />
|-<br />
| byring ''s''1<br />
| <br />
| ''New in 1.8.2'': All rings of size ≤ 7 which have at least one atom in ''s''1<br />
<pre>PyMOL> select rings, byring (all)</pre><br />
<br />
|-<br />
| neighbor ''s''1<br />
| nbr. ''s''1<br />
| Selects atoms directly bonded to ''s''1, excludes ''s''1.<br />
<pre>PyMOL> select vicinos, neighbor resi 10</pre><br />
<br />
|-<br />
| bound_to ''s1''<br />
| bto. ''s1''<br />
| Selects atoms directly bonded to ''s1'', may include ''s1''.<br />
<br />
|-<br />
| ''s''1 extend ''X''<br />
| ''s''1 xt. ''X''<br />
| Extends ''s''1 by ''X'' bonds connected to atoms in ''s''1.<br />
<pre>PyMOL> select connect_x, near10 extend 3</pre><br />
<br />
|-<br />
| pepseq ''SEQ''<br />
| ps. ''SEQ''<br />
| Selects peptide sequence matching upper-case one-letter sequence ''SEQ'' (see also [[FindSeq]]).<br />
<pre>PyMOL> select 1tvn and ps. FATEW</pre><br />
<br />
|-<br />
| rep ''rep''<br />
|<br />
| Selects atoms which show representation ''rep''.<br />
<pre>PyMOL> select sele, rep spheres</pre><br />
<br />
|}<br />
<br />
== Comparison of distance operators ==<br />
<br />
There are serveral very similar operators that select by pairwise atom distances. The following table lists the details how they differ.<br />
<br />
'''Syntax 1''': ''s1'' operator X of ''s2''<br><br />
'''Syntax 2''': ''s1'' and (''s2'' operator X)<br />
<br />
{| border=1 cellspacing=0 cellpadding=4 style="text-align:center" class=wikitable<br />
! operator !! distance is ... !! measured from !! includes s2 !! syntax !! notes<br />
|-<br />
| near_to || ≤ X || center || never || 1 || equivalent to "around"<br />
|-<br />
| within || ≤ X || center ||if matches s1|| 1 ||<br />
|-<br />
| beyond || > X || center || never || 1 ||<br />
|-<br />
| gap || > X || center+vdw || never || 2 ||<br />
|-<br />
| around || ≤ X || center || never || 2 || equivalent to "near_to"<br />
|-<br />
| expand || ≤ X || center || always || 2 ||<br />
|}<br />
<br />
== Examples ==<br />
Logical selections can be combined. For example, you might select atoms that are part of chain a, but not residue number 125:<br />
<source lang="python"><br />
# selects atoms that are part of chain A, but not residue number 125.<br />
select chain A and (not resi 125)<br />
<br />
# The following two selections are equivalent, <br />
select (name CB or name CG1 or name CG2) and chain A<br />
<br />
# select c-beta's, c-gamma-1's and c-gamma-2's <br />
# that are in chain A.<br />
select name CB+CG1+CG2 and chain A<br />
<br />
# select all residues within 5 Ang. or any organic small molecules<br />
select br. all within 5 of organic<br />
<br />
# select helices<br />
select ss 'H'<br />
<br />
# select anything shown as a line<br />
select rep lines<br />
<br />
# select all residues with a b-factor less than 20, within 3 angstroms of any water<br />
select br. b<20 & (all within 3 of resn HOH)<br />
<br />
# select anything colored blue<br />
select color blue<br />
<br />
# select the 1st arginine<br />
select first resn ARG<br />
<br />
# select 1foo's segment G's chain X's residue 444's alpha carbon<br />
select 1foo/G/X/444/CA<br />
# same thing<br />
select 1foo and segi G and c. X and i. 444 and n. CA<br />
<br />
# select the entire object that residue 23's beta caron is in:<br />
select bo. i. 23 and n. CA<br />
<br />
# select the molecule that chain C is in<br />
select bm. c. C<br />
</source><br />
<br />
Like the results of groups of arithmetic operations, the results of groups of logical operations depend on which operation is performed first. They have an order of precedence. To ensure that the operations are performed in the order you have in mind, use parentheses:<br />
<br />
<source lang="python">byres ((chain A or (chain B and (not resi 125))) around 5)</source><br />
<br />
PyMOL will expand its logical selection out from the innermost parentheses.<br />
<br />
== See Also ==<br />
<br />
[[Single-word Selectors]], [[Selection Macros]], [[Property_Selectors]], [[Identify]]<br />
<br />
[[Category:Selector Quick Reference]]<br />
[[Category:Selecting|Selection Algebra]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=PyMOLProbity&diff=12505PyMOLProbity2017-01-16T04:19:26Z<p>Jaredsampson: /* Description */ add link to repository</p>
<hr />
<div>{{Infobox script-repo<br />
|type = plugin<br />
|download = https://github.com/jaredsampson/pymolprobity/raw/master/pymolprobity.tar.gz<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
== Description ==<br />
[[File:PyMOLProbity_GUI.png|480px|thumb|right|The PyMOLProbity GUI can be used to inspect and adjust clashes and flip orientations of flippable side chain groups.]]<br />
<br />
[https://github.com/jaredsampson/pymolprobity PyMOLProbity] is a plugin allows the user to produce MolProbity-style<br />
visualization of atomic interactions within a structure (e.g. H-bonds, van der<br />
Waals interactions and clashes) directly within a PyMOL session. The plugin<br />
runs local copies of several executable programs from the <br />
[http://kinemage.biochem.duke.edu/ Richardson Lab] at Duke University, <br />
authors of the [http://molprobity.biochem.duke.edu/ MolProbity] software, parses the output, and<br />
displays the results in the PyMOL viewport. There are both a graphical user<br />
interface (GUI) for general point-and-click use, and a command-line interface<br />
(CLI) suitable for scripting.<br />
<br />
== Installation ==<br />
<br />
For installation instructions, please see the [https://github.com/jaredsampson/pymolprobity/blob/master/README.md README] file in the <br />
[https://github.com/jaredsampson/pymolprobity repository].<br />
<br />
== Getting Started ==<br />
<br />
=== GUI ===<br />
<br />
Once PyMOLProbity is installed, it should appear as an option in PyMOL's ''Plugin'' menu. Load or fetch a structure, and launch the GUI by selecting ''Plugin > PyMOLProbity''.<br />
<br />
* Use the ''Add Hydrogens'' tab to add hydrogens with Reduce. This will also calculate which N/Q/H residue side chains should be flipped, and perform those flips. Note that this should be done even if the model already includes explicit hydrogens.<br />
* To examine these more closely, select the ''Review Flips'' tab. Here, you can zoom to inspect each flippable residue and choose the ones you wish to keep or change. Save any changes using the '''''Save Selections''''' button. <br />
* Finally, use the ''Visualize Contacts'' tab to run Probe on the modified coordinates and generate contact dots and clash vectors for all the atoms in your object.<br />
<br />
=== Command-Line Interface ===<br />
<br />
The plugin makes the following functions available:<br />
<br />
* '''reduce_obj'''(obj, flip=1): Run reduce on a loaded PyMOL object (or named selection) with (default) or without making the Asn/Gln/His flips recommended by Reduce.<br />
<br />
* '''flipkin_obj'''(obj): Run Flipkin to create both NQ and H flipkin kinemage visualization of the Reduce-modified structure.<br />
<br />
* '''probe_obj'''(obj): Run Probe on either a structure saved from the Flipkin tab of the GUI, or the Reduce-modified structure.<br />
<br />
Note that both `flipkin_obj` and `probe_obj` require previously having run `reduce_obj` on the same object.<br />
<br />
<br />
[[Category:Plugins]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=PyMOLProbity&diff=12504PyMOLProbity2017-01-14T17:48:13Z<p>Jaredsampson: /* Getting Started */ Update GUI section.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = plugin<br />
|download = https://github.com/jaredsampson/pymolprobity/raw/master/pymolprobity.tar.gz<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
== Description ==<br />
[[File:PyMOLProbity_GUI.png|480px|thumb|right|The PyMOLProbity GUI can be used to inspect and adjust clashes and flip orientations of flippable side chain groups.]]<br />
<br />
PyMOLProbity is a plugin allows the user to produce MolProbity-style<br />
visualization of atomic interactions within a structure (e.g. H-bonds, van der<br />
Waals interactions and clashes) directly within a PyMOL session. The plugin<br />
runs local copies of several executable programs from the <br />
[http://kinemage.biochem.duke.edu/ Richardson Lab] at Duke University, <br />
authors of the [http://molprobity.biochem.duke.edu/ MolProbity] software, parses the output, and<br />
displays the results in the PyMOL viewport. There are both a graphical user<br />
interface (GUI) for general point-and-click use, and a command-line interface<br />
(CLI) suitable for scripting.<br />
<br />
== Installation ==<br />
<br />
For installation instructions, please see the [https://github.com/jaredsampson/pymolprobity/blob/master/README.md README] file in the <br />
[https://github.com/jaredsampson/pymolprobity repository].<br />
<br />
== Getting Started ==<br />
<br />
=== GUI ===<br />
<br />
Once PyMOLProbity is installed, it should appear as an option in PyMOL's ''Plugin'' menu. Load or fetch a structure, and launch the GUI by selecting ''Plugin > PyMOLProbity''.<br />
<br />
* Use the ''Add Hydrogens'' tab to add hydrogens with Reduce. This will also calculate which N/Q/H residue side chains should be flipped, and perform those flips. Note that this should be done even if the model already includes explicit hydrogens.<br />
* To examine these more closely, select the ''Review Flips'' tab. Here, you can zoom to inspect each flippable residue and choose the ones you wish to keep or change. Save any changes using the '''''Save Selections''''' button. <br />
* Finally, use the ''Visualize Contacts'' tab to run Probe on the modified coordinates and generate contact dots and clash vectors for all the atoms in your object.<br />
<br />
=== Command-Line Interface ===<br />
<br />
The plugin makes the following functions available:<br />
<br />
* '''reduce_obj'''(obj, flip=1): Run reduce on a loaded PyMOL object (or named selection) with (default) or without making the Asn/Gln/His flips recommended by Reduce.<br />
<br />
* '''flipkin_obj'''(obj): Run Flipkin to create both NQ and H flipkin kinemage visualization of the Reduce-modified structure.<br />
<br />
* '''probe_obj'''(obj): Run Probe on either a structure saved from the Flipkin tab of the GUI, or the Reduce-modified structure.<br />
<br />
Note that both `flipkin_obj` and `probe_obj` require previously having run `reduce_obj` on the same object.<br />
<br />
<br />
[[Category:Plugins]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=PyMOLProbity&diff=12503PyMOLProbity2017-01-14T17:41:55Z<p>Jaredsampson: Add screenshot.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = plugin<br />
|download = https://github.com/jaredsampson/pymolprobity/raw/master/pymolprobity.tar.gz<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
== Description ==<br />
[[File:PyMOLProbity_GUI.png|480px|thumb|right|The PyMOLProbity GUI can be used to inspect and adjust clashes and flip orientations of flippable side chain groups.]]<br />
<br />
PyMOLProbity is a plugin allows the user to produce MolProbity-style<br />
visualization of atomic interactions within a structure (e.g. H-bonds, van der<br />
Waals interactions and clashes) directly within a PyMOL session. The plugin<br />
runs local copies of several executable programs from the <br />
[http://kinemage.biochem.duke.edu/ Richardson Lab] at Duke University, <br />
authors of the [http://molprobity.biochem.duke.edu/ MolProbity] software, parses the output, and<br />
displays the results in the PyMOL viewport. There are both a graphical user<br />
interface (GUI) for general point-and-click use, and a command-line interface<br />
(CLI) suitable for scripting.<br />
<br />
== Installation ==<br />
<br />
For installation instructions, please see the [https://github.com/jaredsampson/pymolprobity/blob/master/README.md README] file in the <br />
[https://github.com/jaredsampson/pymolprobity repository].<br />
<br />
== Getting Started ==<br />
<br />
=== First run ===<br />
<br />
Now you can open PyMOL, load or fetch a structure, and launch PyMOLProbity from<br />
the Plugin menu. <br />
<br />
* Use the ''Add Hydrogens'' tab to add hydrogens with Reduce. This will also calculate which N/Q/H residue side chains should be flipped. <br />
* If you would like to examine these more closely, use the ''Review Flips'' tab to examine each flippable residue and choose the ones you wish to flip or keep.<br />
* Save these using the ''Save Selections'' button. <br />
* Finally, use the ''Visualize Contacts'' tab to run Probe on the modified coordinates and generate contact dots and clash vectors for all the atoms in your object.<br />
<br />
=== Command-Line Interface ===<br />
<br />
The plugin makes the following functions available:<br />
<br />
* '''reduce_obj'''(obj, flip=1): Run reduce on a loaded PyMOL object (or named selection) with (default) or without making the Asn/Gln/His flips recommended by Reduce.<br />
<br />
* '''flipkin_obj'''(obj): Run Flipkin to create both NQ and H flipkin kinemage visualization of the Reduce-modified structure.<br />
<br />
* '''probe_obj'''(obj): Run Probe on either a structure saved from the Flipkin tab of the GUI, or the Reduce-modified structure.<br />
<br />
Note that both `flipkin_obj` and `probe_obj` require previously having run `reduce_obj` on the same object.<br />
<br />
<br />
[[Category:Plugins]]</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=File:PyMOLProbity_GUI.png&diff=12502File:PyMOLProbity GUI.png2017-01-14T17:39:51Z<p>Jaredsampson: Screenshot of the "Review Flips" tab of the PyMOLProbity plugin GUI, where flippable side chains in the selected object can be inspected, animated between unflipped (i.e. Reduce-output) and flipped orientations, and selected for future operations.</p>
<hr />
<div>Screenshot of the "Review Flips" tab of the PyMOLProbity plugin GUI, where flippable side chains in the selected object can be inspected, animated between unflipped (i.e. Reduce-output) and flipped orientations, and selected for future operations.</div>Jaredsampsonhttps://pymolwiki.org/index.php?title=PyMOLProbity&diff=12501PyMOLProbity2017-01-14T05:52:15Z<p>Jaredsampson: Created page.</p>
<hr />
<div>{{Infobox script-repo<br />
|type = plugin<br />
|download = https://github.com/jaredsampson/pymolprobity/raw/master/pymolprobity.tar.gz<br />
|author = [[User:jaredsampson|Jared Sampson]]<br />
|license = MIT<br />
}}<br />
<br />
== Description ==<br />
[[Image:PyMOLProbity_GUI.png|480px|thumb|The PyMOLProbity GUI can be used to inspect and adjust clashes and flip orientations of flippable side chain groups.]]<br />
<br />
PyMOLProbity is a plugin allows the user to produce MolProbity-style<br />
visualization of atomic interactions within a structure (e.g. H-bonds, van der<br />
Waals interactions and clashes) directly within a PyMOL session. The plugin<br />
runs local copies of several executable programs from the <br />
[http://kinemage.biochem.duke.edu/ Richardson Lab] at Duke University, <br />
authors of the [http://molprobity.biochem.duke.edu/ MolProbity] software, parses the output, and<br />
displays the results in the PyMOL viewport. There are both a graphical user<br />
interface (GUI) for general point-and-click use, and a command-line interface<br />
(CLI) suitable for scripting.<br />
<br />
== Installation ==<br />
<br />
For installation instructions, please see the [https://github.com/jaredsampson/pymolprobity/blob/master/README.md README] file in the <br />
[https://github.com/jaredsampson/pymolprobity repository].<br />
<br />
== Getting Started ==<br />
<br />
=== First run ===<br />
<br />
Now you can open PyMOL, load or fetch a structure, and launch PyMOLProbity from<br />
the Plugin menu. <br />
<br />
* Use the ''Add Hydrogens'' tab to add hydrogens with Reduce. This will also calculate which N/Q/H residue side chains should be flipped. <br />
* If you would like to examine these more closely, use the ''Review Flips'' tab to examine each flippable residue and choose the ones you wish to flip or keep.<br />
* Save these using the ''Save Selections'' button. <br />
* Finally, use the ''Visualize Contacts'' tab to run Probe on the modified coordinates and generate contact dots and clash vectors for all the atoms in your object.<br />
<br />
=== Command-Line Interface ===<br />
<br />
The plugin makes the following functions available:<br />
<br />
* '''reduce_obj'''(obj, flip=1): Run reduce on a loaded PyMOL object (or named selection) with (default) or without making the Asn/Gln/His flips recommended by Reduce.<br />
<br />
* '''flipkin_obj'''(obj): Run Flipkin to create both NQ and H flipkin kinemage visualization of the Reduce-modified structure.<br />
<br />
* '''probe_obj'''(obj): Run Probe on either a structure saved from the Flipkin tab of the GUI, or the Reduce-modified structure.<br />
<br />
Note that both `flipkin_obj` and `probe_obj` require previously having run `reduce_obj` on the same object.<br />
<br />
<br />
[[Category:Plugins]]</div>Jaredsampson