Question: creating a python script to load a protein molecule and export it as .png file in pymol, without using GUI
0
gravatar for manasvenikilnagar
2.3 years ago by
manasvenikilnagar0 wrote:

Hi friends, I am trying to create a python script which can load a protein molecule from a .pdb file and export it as .png file in pymol, without the GUI opening up. This is my script :

#!/usr/bin/env python
import __main__
__main__.pymol_argv = [ 'pymol', '-c'] 
import sys, time, os
import pymol
pymol.finish_launching()
spath = os.path.abspath(sys.argv[1])
sname = spath.split('/')[-1].split('.')[0]
pymol.cmd.load(spath, sname)
pymol.cmd.disable("all")
pymol.cmd.enable(sname)
pymol.cmd.hide('all')
pymol.cmd.png("my_image.png")
pymol.cmd.quit()

I am not getting a png image of the molecule. Pls help me out.

pymol • 1.2k views
ADD COMMENTlink modified 2.3 years ago by WouterDeCoster39k • written 2.3 years ago by manasvenikilnagar0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 908 users visited in the last hour