creating a python script to load a protein molecule and export it as .png file in pymol, without using GUI
0
0
Entering edit mode
7.2 years ago

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 • 3.2k views
ADD COMMENT

Login before adding your answer.

Traffic: 2711 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6