Endonuclease PvuII (1PVI) DNA - GATTACAGATTACA
CAP - Catabolite gene Activating Protein (1BER)
DNA - GATTACAGATTACAGATTACA Endonuclease PvuII bound to palindromic DNA recognition site CAGCTG (1PVI) DNA - GATTACAGATTACAGATTACA TBP - TATA box Binding Protein (1C9B)
CAP - Catabolite gene Activating Protein (1BER)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
TBP - TATA box Binding Protein (1C9B)
 

° 

RayTrace

-

Create raytraced screenshot using POVRay


CommandArgumentDatatypeDefault Min Max
Format: RayTrace Filename = BMP/PNG output filename,STRING-- -
   X = X-Size in pixels,INT1024- -
   Y = Y-Size in pixels,INT768- -
   zoom = Ball zoom factor,FLOAT1.0- -
   Atoms = Balls | Blobs,STRINGBalls --
  LabelShadow = Yes | No, STRINGNo- -
   SecAlpha = Secondary structure alpha blending factor in percent, FLOAT100.00.0100.0
  Display = On | Off,STRING On --
  Outline = radius of comic outline in Å,FLOAT 0.0--
   Background = On | OffSTRINGOn - -
Python: RayTrace(filename,x=None,y=None,zoom=None,atoms=None,labelshadow=None,secalpha=None,display=None,outline=None,background=None)
Menu:File > Save as > Ray-traced screenshot
Related:SaveBMP, SavePOV , Lightsource, Antialias
Required:


The RayTrace command runs the PovRay program (www.povray.org ) to create a photorealistic, ray-traced screenshot including shadows.

The specified image size should have the same aspect ratio as the YASARA window, so it should be a multiple of the YASARA window size . Similarily, if you want to create a ray-traced image with a given aspect ratio, e.g. 15x10 cm, choose the same ratio also for the YASARA window size , e.g. 900x600 pixels, and then ray-trace at higher resolution, e.g. 1600x1200 pixels.

If something is missing in the ray-traced output that is nevertheless visible in the YASARA window, the reason may be a slight difference in the treatment of very small spheres and lines: in the ray-traced output, they can become smaller than a single pixel and thus disappear all together, while YASARA always keeps a minimum size. Just increase the size to solve the problem.

In order to include fog or comic style outlines activated with the Outline parameter, the image has to be rendered a second time as a grayscale depth map. You can avoid the second render pass by setting fog and 'outline' to 0.

The on-screen possibility to activate specular highlights (spotlight reflections) independently for atoms and surfaces is currently not supported in the ray-traced image. Instead, click View > Atom appearance > Texture and choose 'Plain with spotlight'/'Plain' to activate/deactivate them globally in the ray-traced image.

Journals usually require images to have a minimum resolution , e.g. 300 dpi. 'dpi' means 'dots per inch' and is the same as 'ppi', 'pixels per inch'. First determine the final size of your image on paper (do you want it to cover just one column? Or the entire page?), then multiply with 300: E.g. if you want an image 4x3 inches large, raytrace it with 1200x900 pixels. If you prefer centimeters, you have to multiply with 0.3937 (1 cm is 0.3937 inches). E.g. an image 8x5 cm large must be raytraced with at least 945x591 pixels. Some image formats store a default dpi value, which does not change when you raytrace at higher resolution. This number is meaningless and can be ignored.

When creating a ray-traced image, it often helps to reduce the shadow density and hide atoms or secondary structure so that only important things are visible. Note that all labels you add will also appear in the output, so you do not have to put them in afterwards.

If you want to create a black&white or schematic representation of your molecule, select the 'Comic' atom texture, which makes sure that shading is disabled in the output, and set the Outline parameter to a value > 0 (e.g. 0.1) to detect the edges. Black outlines will then be drawn around all elements of the scene - with the exception of black labels to make sure that also schematic images can be labelled properly. If required, you can then postprocess the image in Gimp or Photoshop.

When displaying atoms as space filling balls , their radii are somewhat smaller than true Van der Waals radii, otherwise you could not see much. If you nevertheless need true Van der Waals radii in ray-traced output, choose a ball zoom factor of 1.5.

If the Background parameter is set to 'no', the background will be transparent. Since BMP files cannot store transparency in the alpha channel, YASARA will create a PNG file instead, even if the chosen filename indicates a BMP file.

Sometimes surfaces and ribbons may contain unexpectedly dark triangles. This is a result of shadow-casting, disable shadows to remove them. On the other hand, no spotlight reflections will be visible if shadows are disabled.

When creating a large number of ray-traced images, it may be convenient to disable the display of the PovRay window by setting 'Display' to 'Off'. This is the default and only option in MacOSX.

If you have a stereo-mode activated, YASARA will automatically create two ray-traced images and add '_L' and '_R' to the filenames. This can also be done using a simple macro without having to activate stereo:

LoadPDB 1crn
Style Ribbon,BallStick
Pos Z=18
# Distance between eyes in Angstrom
eyedistance=2.
# Name of stereo images
imagename='1crn_stereo'
imagelist='L','','R'
for i=-1 to 1 step 2
  Move X=(eyedistance*i/2)
  RayTrace (imagename)_(imagelist(i+2)),X=1024,Y=768
  Move X=(-eyedistance*i/2)

Note that the labelling with 'L'eft and 'R'ight is quite arbitrary, because it depends on the way you look at the two images (cross-eyed or parallel) and on the handedness of YASARA's global coordinate system .

Example 1:
RayTrace 1crn,1024,768,Zoom=1.2,Atoms=Blobs

Run PovRay to save a ray-traced 1024x768 screenshot as png/1crn.png, with atom balls 1.2 times the usual size, displaying all atoms as smooth blobs.


Example 2:
RayTrace 1crn,1024,768,LabelShadow=Yes,SecAlpha=50

Save a ray-traced 1024x768 screenshot as png/1crn.png, with labels casting shadows and all secondary structure half transparent.


Example 3:
RayTrace 1crn,800,600,Outline=0.1,Background=off

Save a ray-traced 800x600 screenshot with a 0.1 A comic-style outline and no background as png/1crn.png.



Example macro 1:

# EXAMPLE RayTrace
# Requires YASARA Model
Clear
# Choose background and fog colors
Fog 100
ColorFog 8080ff
ColorBG 404080,8080ff
# Load and style the protein
AtomTexture 5
LoadPDB 1crn
Style Cartoon,BallStick
# Build the cell with textured sides
LoadBMP ysrbkgr1
len=40
SimCell (len),(len),(len)
for i=1 to 3
  MakeImageObj wall(i),ysrbkgr1,(len),(len)
MoveObj wall1,Z=(len/2)
MoveObj wall2,X=(-len/2)
OriObj wall2,Beta=90
MoveObj wall3,Y=(-len/2)
OriObj wall3,Alpha=90
OriAll -8.388,61.049,-33.919
# Raytrace the scene
RayTrace cellexample
# And load the image
Clear
LoadBMP cellexample
ShowImage cellexample

Figure: Result of the example macro 1 above.



Example macro 2:

# EXAMPLE RayTrace Comic
# Requires YASARA Model
Clear
# Load and style the protein (8 is the comic texture)
LoadYOb 1fe0
Style Ribbon
AtomTexture 8
HideSecStrMol A,Yes
BallMol A
# Show a partial surface
AddEnvAll
SurfPar Molecular=Analytic
ShowSurfAtom globalX>11,molecular,dynamic,OutCol=Blue,OutAlpha=100,InCol=Blue,InAlpha=100
# Raytrace with 0.1 A outline width and normal colors
RayTrace comiccol,outline=0.1
# Raytrace with 0.2 A outline width and single color
Fog 0
ColorObj 1,grey
ColorBG white
ColorSurfObj 1,molecular,grey
RayTrace comicbw,outline=0.2
# Load the two figures
Clear
LoadBMP comiccol
LoadBMP comicbw
# Blend the two figures
ShowImage comiccol,Alpha=0
ShowImage comicbw
Console Off
for i=1 to 4
  for a in 0,100
    AutoMoveImage comiccol,Alpha=(a^100),Steps=100
    AutoMoveImage comicbw,Alpha=(a),Steps=100
    Wait 300

Figure: Result of the example macro 2 above.