<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Englebip</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Englebip"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Englebip"/>
	<updated>2026-04-30T10:56:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Clip&amp;diff=3312</id>
		<title>Clip</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Clip&amp;diff=3312"/>
		<updated>2008-11-06T15:31:07Z</updated>

		<summary type="html">&lt;p&gt;Englebip: /* SEE ALSO */ bullet list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===DESCRIPTION===&lt;br /&gt;
'''clip''' alters the near and far clipping planes&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 clip {near|far|move|slab|atoms}, distance [,selection [,state ]]&lt;br /&gt;
&lt;br /&gt;
===EXAMPLES===&lt;br /&gt;
 clip near, -5           # moves near plane away from you by 5 A&lt;br /&gt;
 clip far, 10            # moves far plane towards you by 10 A&lt;br /&gt;
 clip move, -5           # moves the slab away from you by 5 A&lt;br /&gt;
 clip slab, 20           # sets slab thickness to 20 A&lt;br /&gt;
 clip slab, 10, resi 11  # clip 10 A slab about residue 11&lt;br /&gt;
 clip atoms, 5, pept     # clip atoms in &amp;quot;pept&amp;quot; with a 5 A buffer&lt;br /&gt;
                         # about their current camera positions&lt;br /&gt;
==PYMOL API==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.clip( string mode, float distance, string selection = None)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
*[[Zoom]]&lt;br /&gt;
*[[Reset]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|clip]]&lt;/div&gt;</summary>
		<author><name>Englebip</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Zoom&amp;diff=5790</id>
		<title>Zoom</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Zoom&amp;diff=5790"/>
		<updated>2008-11-06T15:28:41Z</updated>

		<summary type="html">&lt;p&gt;Englebip: fixed see also links in bullets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===DESCRIPTION===&lt;br /&gt;
'''zoom''' scales and translates the window and the origin to cover the atom selection.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 zoom [ selection [,buffer [, state [, complete ]]]]&lt;br /&gt;
&lt;br /&gt;
===EXAMPLES===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# auto zoom depending on what's loaded in PyMOL&lt;br /&gt;
zoom&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
zoom complete=1&lt;br /&gt;
&lt;br /&gt;
# zoom on just chain A&lt;br /&gt;
zoom (chain A)&lt;br /&gt;
&lt;br /&gt;
# zoom on residue 142&lt;br /&gt;
zoom 142/&lt;br /&gt;
&lt;br /&gt;
# zoom consistenly 20 Ang from each object at the center&lt;br /&gt;
center prot1&lt;br /&gt;
zoom center, 20&lt;br /&gt;
&lt;br /&gt;
# prot1 and prot2 will have the same exact zoom factor&lt;br /&gt;
center prot2&lt;br /&gt;
zoom center, 20&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt; &lt;br /&gt;
cmd.zoom( string selection, float buffer=0.0,&lt;br /&gt;
          int state=0, int complete=0 )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===NOTES===&lt;br /&gt;
 state = 0 (default) use all coordinate states&lt;br /&gt;
 state = -1 use only coordinates for the current state&lt;br /&gt;
 state &amp;gt; 0  use coordinates for a specific state&lt;br /&gt;
&lt;br /&gt;
 complete = 0 or 1:&lt;br /&gt;
&lt;br /&gt;
Normally the zoom command tries to guess an optimal zoom level for visualization, balancing closeness against occasional clipping of atoms out of the field of view.  You can change this behavior by setting the complete option to 1, which will guarantee that the atom positions for the entire selection will fit in the field of an orthoscopic view.  To absolutely prevent clipping, you may also need to add a buffer (typically 2 A) to account for the perspective transformation and for graphical representations which extend beyond the atom coordinates.&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
*[[Origin]]&lt;br /&gt;
*[[Orient]]&lt;br /&gt;
*[[Center]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|zoom]]&lt;/div&gt;</summary>
		<author><name>Englebip</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Publication_Quality_Images&amp;diff=8483</id>
		<title>Publication Quality Images</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Publication_Quality_Images&amp;diff=8483"/>
		<updated>2008-11-04T20:53:07Z</updated>

		<summary type="html">&lt;p&gt;Englebip: /* See Also */ made into a bullet list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==High Resolution (DPI) Images==&lt;br /&gt;
&lt;br /&gt;
===Creating Resolution Specific Images===&lt;br /&gt;
We often get the question:&lt;br /&gt;
 Q.  How do I create a X DPI image using PyMol's 'ray' command?&lt;br /&gt;
&lt;br /&gt;
The answer is deceivingly simple.  There are two steps in the process.  First, setup your scene and use [[Cmd ray|ray]] like this&lt;br /&gt;
 ray 2400, 2400&lt;br /&gt;
From this you will get a large square image.  You can now resize it to X inches where X=A*B, A and B factors of 2400  (eg: 8 inch photo @ 300DPI, 4 inch photo at 600DPI, 2 inch photo @ 1200DPI).  The formula for creating images is:&lt;br /&gt;
 rayVal = inches * DPI&lt;br /&gt;
where rayVal is the value you pass to &amp;quot;ray&amp;quot;.  Thus, an 8 inch square photo at 72, 100, and 300 DPI would be created by the following commands:&lt;br /&gt;
 ray 576,576   # 8inch * 72dpi&lt;br /&gt;
 ray 800,800   # 8inch * 100dpi; or a 4inch * 200 DPI photo; or 1x800.&lt;br /&gt;
 ray 2400,2400 # 8inch * 300dpi; 6&amp;quot;x400dpi, etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''new and better solution''' is to use the [[Png]] command with the '''dpi''' setting, such as&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
png fileName, dpi=300&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you don't have a new enough version of PyMOL that supports this, then the '''old solution''' is to use [[PhotoShop]] or [[GIMP]] to resize the photo to the appropriate height and width while making sure also to tell the [[PhotoShop]] or [[GIMP]] what resolution the image is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====GIMP 2.0=====&lt;br /&gt;
In Gimp, load your image (it'll most likely be very large) then &lt;br /&gt;
*Select:&lt;br /&gt;
 Image -&amp;gt;&lt;br /&gt;
 Scale Image -&amp;gt;&lt;br /&gt;
 'Print Size &amp;amp; Scale Image Section' change 'New Width' to whatever width you decided on before.&lt;br /&gt;
* Save Image (File-&amp;gt;Save)&lt;br /&gt;
&lt;br /&gt;
You should be set.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Png]]&lt;br /&gt;
* [[Ray]] &lt;br /&gt;
* [[Draw]]&lt;br /&gt;
* [[CMYK]]&lt;br /&gt;
* the rest of the pages in this [[:Category:Publication_Quality|Category]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Image_Manipulation|Publication Quality Images]]&lt;br /&gt;
[[Category:Publication_Quality|Publication Quality Images]]&lt;/div&gt;</summary>
		<author><name>Englebip</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Ray&amp;diff=9962</id>
		<title>Ray</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Ray&amp;diff=9962"/>
		<updated>2008-11-04T16:21:46Z</updated>

		<summary type="html">&lt;p&gt;Englebip: changed formatting, moved gallery further down so that it doesn't clash with TOC; title case section titles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ray''' creates a ray-traced image of the current frame. This command is used to make high-resolution photos fit for publication and formal movies.  Please note, the '''ray''' command can take some time (up to several minutes, depending on image complexity and size).&lt;br /&gt;
&lt;br /&gt;
For those who are making movies with PyMOL, '''Ray''' is one of the most commonly used last steps before stitching the frames together to compile the movie.  '''Ray''' has many powerful features such as setting the size of the image -- and it still works even if the [[Viewport]] or screen is smaller than the requested output file dimensions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery align=&amp;quot;center&amp;quot; heights=&amp;quot;200px&amp;quot; widths=&amp;quot;200px&amp;quot;&amp;gt;&lt;br /&gt;
Image:Noray.png|Image, not ray traced.&lt;br /&gt;
Image:Ray1.png|Image, ray traced.&lt;br /&gt;
Image:Ray2.png|Image, ray traced; different mode.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
 ray [width,height [,renderer [,angle [,shift ]]]&lt;br /&gt;
'''angle''' and '''shift''' can be used to generate matched stereo pairs&lt;br /&gt;
&lt;br /&gt;
==PyMol API==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;cmd.ray(int width,int height,int renderer=-1,float shift=0)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
===Modes===&lt;br /&gt;
Setting the '''[[Ray_trace_mode]]''' variable in PyMOL changes the way PyMOL's internal renderer represents proteins in the final output.  New modes were recently added to give the user more options of molecular representation.  New modes are: normal rendering, but with a black outline (nice for presentations); black and white only; quantized color with black outline (also, very nice for presentations; more of a ''cartoony'' appearance).  &lt;br /&gt;
&lt;br /&gt;
'''Note:''' Mode 3, the quantized color one, sort of '''burns''' the background if you're using this setting.  This will make a pure white background somewhat &amp;quot;offwhite&amp;quot;; thus, a poster would look poor because you could see the border for the image.  If you'll be using this mode, try the [[ray_opaque_background]] setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# normal color&lt;br /&gt;
set ray_trace_mode, 0&lt;br /&gt;
&lt;br /&gt;
# normal color + black outline&lt;br /&gt;
set ray_trace_mode,  1&lt;br /&gt;
&lt;br /&gt;
# black outline only&lt;br /&gt;
set ray_trace_mode,  2&lt;br /&gt;
&lt;br /&gt;
# quantized color + black outline&lt;br /&gt;
set ray_trace_mode,  3&lt;br /&gt;
&lt;br /&gt;
set ray_trace_mode, 1 # (or 2 or 3; best with &amp;quot;bg_color white;set antialias,2&amp;quot;)&lt;br /&gt;
# These two new modes -- 2 and 3 -- are cool cartoon looking modes.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are the example images for the new modes&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ray_mode_1_ex.png|set ray_trace_mode,1&lt;br /&gt;
Image:Ray_mode_2_ex.png|set ray_trace_mode,2&lt;br /&gt;
Image:Ray_mode_3_ex.png|set ray_trace_mode,3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Perspective===&lt;br /&gt;
====Perspective Example Images====&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:No_persp.png|Example with Perspective Turned Off&lt;br /&gt;
Image:Persp1.png|Example with Perspective Turned On&lt;br /&gt;
Image:Persp2.png|Example with Perspective Turned On and Field of View Set High (70).&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Notes=====&lt;br /&gt;
PyMol 0.97 and prior used '''orthoscopic''' rendering -- that is, no perspective.  Upon the arrival of 0.98 and later, we get perspective based rendering at a cost of a 4x decrease in render speed.  If you want perspective&lt;br /&gt;
 set orthoscopic, off&lt;br /&gt;
Otherwise&lt;br /&gt;
 set orthoscopic, on&lt;br /&gt;
To magnify the effect of perspective on the scene,&lt;br /&gt;
 set field_of_view, X&lt;br /&gt;
where 50&amp;lt;X&amp;lt;70.  Default is 20.  50-70 gives a very strong perspective effect.  Nb. the field of view is in Y, not X as one would expect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Renderer===&lt;br /&gt;
'''renderer = -1''' is default (use value in ray_default_renderer)&lt;br /&gt;
&lt;br /&gt;
'''renderer =  0''' uses PyMOL's internal renderer&lt;br /&gt;
&lt;br /&gt;
'''renderer =  1''' uses PovRay's renderer.  This is Unix-only and you must have &amp;quot;x-povray&amp;quot; in your path.  It utilizes two temporary files: &amp;quot;tmp_pymol.pov&amp;quot; and &amp;quot;tmp_pymol.png&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Performance==&lt;br /&gt;
*The ray performance depends on distance between camera and molecule.&lt;br /&gt;
If the distance is big rendering takes much time. If the distance is too small distant parts of molecule dissolve.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Close_ray.png|Too close to molecule&lt;br /&gt;
Image:Middle_ray.png|Normal distance&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
* Tip: If you have a rather complicated scene that is zoomed into only a part of the molecule, you can speed up the ray tracing by hiding everything else outside of a certain range of the zoomed-on point.  For example, if I have a large molecule and I'm looking only at the 30-atom ligand bound to it, then I can do something like the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# setup your complex scene&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
# zoom on the hetero atom (ligand and not water) within 5 Angstroms&lt;br /&gt;
select hh, het and not resn HOH&lt;br /&gt;
zoom hh, 5&lt;br /&gt;
&lt;br /&gt;
# turn on depth cueing&lt;br /&gt;
set depth_cue, 1&lt;br /&gt;
&lt;br /&gt;
# now, select stuff to hide; we select everything that is &lt;br /&gt;
# farther than 8 Ang from our main selection&lt;br /&gt;
select th, (all) and not ( (all) within 8 of hh) )&lt;br /&gt;
&lt;br /&gt;
hide everything, th&lt;br /&gt;
&lt;br /&gt;
# any additional commands you want&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ray&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As an example of the efficacy of this method, I ray traced a rather complex scene with all the atoms visible here's the output of ray:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PyMOL&amp;gt;ray&lt;br /&gt;
 Ray: render time: 24.50 sec. = 146.9 frames/hour (941.88 sec. accum.).&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and here is the result when I soft-clipped everything else using the above method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PyMOL&amp;gt;ray&lt;br /&gt;
 Ray: render time: 47.93 sec. = 75.1 frames/hour (989.80 sec. accum.).&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The two images in the following gallery show the results of the rendering.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ray_method_off.png|normal ray tracing.  This took twice as long to make as the image to the right.  Same size, and DPI.&lt;br /&gt;
Image:Ray_method_on.png|manually hiding things you won't see anyway.  This took 1/2 the time to render as compared to the same sized &amp;amp; DPId image at left.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Simple===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# ray trace the current scene using the default size of the viewport&lt;br /&gt;
ray&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Specify Image Size===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# ray trace the current scene, but scaled to 1024x768 pixels&lt;br /&gt;
ray 1024,768&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Specify Renderer===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# ray trace with an external renderer.&lt;br /&gt;
ray renderer=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===High Quality B&amp;amp;W Rendering===&lt;br /&gt;
[[Image:1l9l.png|thumb|center|Black and White (ray_trace_mode,2); click to see full image]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Black and White Script&lt;br /&gt;
load /tmp/3fib.pdb;&lt;br /&gt;
show cartoon;&lt;br /&gt;
set ray_trace_mode, 2;  # black and white cartoon&lt;br /&gt;
bg_color white;&lt;br /&gt;
set antialias, 2;&lt;br /&gt;
ray 600,600&lt;br /&gt;
png /tmp/1l9l.png&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===High Quality Color===&lt;br /&gt;
[[Image:1l9l_2.png|thumb|center|Color mode (ray_trace_mode,3); click to see full image]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Color Script&lt;br /&gt;
load /tmp/thy_model/1l9l.pdb;&lt;br /&gt;
hide lines;&lt;br /&gt;
show cartoon;&lt;br /&gt;
set ray_trace_mode, 3; # color&lt;br /&gt;
bg_color white;&lt;br /&gt;
set antialias, 2;&lt;br /&gt;
remove resn HOH&lt;br /&gt;
remove resn HET&lt;br /&gt;
ray 600,600&lt;br /&gt;
png /tmp/1l9l.png&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ray Tracing Stereo Images===&lt;br /&gt;
:''See [[Stereo_Ray]]''&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
# &amp;quot;help faster&amp;quot; for optimization tips with the builtin renderer. &amp;quot;help povray&amp;quot; for how to use PovRay instead of PyMOL's built-in    ray-tracing engine.  For high-quality photos, please also see the [[Antialias]] command.  [[Ray shadows]] for controlling shadows.&lt;br /&gt;
# See also [[Ray Tracing]].&lt;br /&gt;
# [http://www.gimp.org/tutorials/Color2BW Desaturation Tutorial] -- A good resource for making nice B&amp;amp;W images from color images (desaturation).&lt;br /&gt;
&lt;br /&gt;
==User comments==&lt;br /&gt;
;How do I ray trace a publication-ready (~300dpi) image using PyMol?&lt;br /&gt;
:This answer is in the [[:Category:Advanced_Issues|Advanced Issues]] (Image Manipulation Section).&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|ray]]&lt;br /&gt;
[[Category:Publication_Quality|ray]]&lt;br /&gt;
[[Category:Performance|ray]]&lt;/div&gt;</summary>
		<author><name>Englebip</name></author>
	</entry>
</feed>