Export Pov-Ray file with a python script.

I'm writing a small python script to generate Pov-Ray with chimera. The script loads a pdb file containing a protein and a ligand, modifies the protein view to ribbon and the ligand to surface. Then exports the .pov file. However the image created by Pov-Ray shows only the surface of ligand. The image is shown correctly in the chimera GUI. If I run the commands one by one in the chimera command line, the .pov file generated is ok. The script is: ----------------------------------------- import chimera from chimera import runCommand runCommand('windowsize 800 600') runCommand('open ../../kinase.domain.2/A.4K9Y.pdb') runCommand('ribbon #0') runCommand('surf ligand') runCommand('export test.pov') ------------------------------------------ After running the script the ReplyLog contains: ----------------------------------------- A.4K9Y.pdb opened /opt/UCSF/Chimera64-1.7/bin/mscalc 1.400000 2.000000 1 MSMSLIB 1.3 started on hamal Copyright M.F. Sanner (March 2000) Compilation flags Surface A.4K9Y.pdb, category ligand, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 436.845 Total solvent accessible surface area = 772.871 ----------------------------------------- Javier Iserte

Hi Javier, I don't have an answer for your specific issue, but while others look at that, a few thoughts... You might also want to hide any atoms/bonds that are displayed (e.g. command: ~disp #0 ). Personally, I have better success making nice images directly in Chimera than via its export to raytracing option. If the main reason you're doing it is to get shadows and/or smoother-looking objects, you might try commands something like: set shadows setattr s density 8 set subdivision 10 However, I understand you may have other reasons for wanting povray files. Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Apr 23, 2014, at 12:48 PM, jiserte@unq.edu.ar wrote:
I'm writing a small python script to generate Pov-Ray with chimera. The script loads a pdb file containing a protein and a ligand, modifies the protein view to ribbon and the ligand to surface. Then exports the .pov file. However the image created by Pov-Ray shows only the surface of ligand.
The image is shown correctly in the chimera GUI. If I run the commands one by one in the chimera command line, the .pov file generated is ok.
The script is: ----------------------------------------- import chimera from chimera import runCommand runCommand('windowsize 800 600') runCommand('open ../../kinase.domain.2/A.4K9Y.pdb') runCommand('ribbon #0') runCommand('surf ligand') runCommand('export test.pov') ------------------------------------------
After running the script the ReplyLog contains:
----------------------------------------- A.4K9Y.pdb opened /opt/UCSF/Chimera64-1.7/bin/mscalc 1.400000 2.000000 1 MSMSLIB 1.3 started on hamal Copyright M.F. Sanner (March 2000) Compilation flags
Surface A.4K9Y.pdb, category ligand, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 436.845 Total solvent accessible surface area = 772.871 -----------------------------------------
Javier Iserte

So the trick is to do insert: runCommand('wait 1') before doing the export. That causes chimera to display the image before doing the export. And that is needed because the ribbon is not generated until it is displayed. HTH, Greg P.S. The POV-Ray output in the 1.9 candidate release (and the daily builds) has been modified to work with the new parallel POV-Ray 3.7. So if you are using POV-Ray, I would recommend installing the 3.7 version and then change the POV-Ray executable in the POV-Ray Options preference to use your installed POV-Ray instead of Chimera's built-in version. On 04/23/2014 12:48 PM, jiserte@unq.edu.ar wrote:
I'm writing a small python script to generate Pov-Ray with chimera. The script loads a pdb file containing a protein and a ligand, modifies the protein view to ribbon and the ligand to surface. Then exports the .pov file. However the image created by Pov-Ray shows only the surface of ligand.
The image is shown correctly in the chimera GUI. If I run the commands one by one in the chimera command line, the .pov file generated is ok.
The script is: ----------------------------------------- import chimera from chimera import runCommand runCommand('windowsize 800 600') runCommand('open ../../kinase.domain.2/A.4K9Y.pdb') runCommand('ribbon #0') runCommand('surf ligand') runCommand('export test.pov') ------------------------------------------
After running the script the ReplyLog contains:
----------------------------------------- A.4K9Y.pdb opened /opt/UCSF/Chimera64-1.7/bin/mscalc 1.400000 2.000000 1 MSMSLIB 1.3 started on hamal Copyright M.F. Sanner (March 2000) Compilation flags
Surface A.4K9Y.pdb, category ligand, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 436.845 Total solvent accessible surface area = 772.871 -----------------------------------------
Javier Iserte
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
Elaine Meng
-
Greg Couch
-
jiserte@unq.edu.ar