-
-
Save moselhy/c84f8439b254ca8e8c5f292cfc4ee8ae to your computer and use it in GitHub Desktop.
Create a png image from a pdb using pymol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF8 -*- | |
""" | |
author: Guillaume Bouvier | |
email: guillaume.bouvier@ens-cachan.org | |
creation date: 2014 04 29 | |
license: GNU GPL | |
Please feel free to use and modify this, but keep the above information. | |
Thanks! | |
""" | |
import sys | |
sys.path.append('/c5/shared/pymol/1.7.0.0-python-2.7.5-shared/lib/python2.7/site-packages/') | |
import __main__ | |
__main__.pymol_argv = ['pymol','-qc'] # Pymol: quiet and no GUI | |
import pymol | |
pymol.finish_launching() | |
pdb_file =sys.argv[1] | |
pdb_name =pdb_file.split('.')[0] | |
pymol.cmd.load(pdb_file, pdb_name) | |
pymol.cmd.disable("all") | |
pymol.cmd.enable(pdb_name) | |
print pymol.cmd.get_names() | |
pymol.cmd.hide('all') | |
pymol.cmd.show('cartoon') | |
pymol.cmd.set('ray_opaque_background', 0) | |
pymol.cmd.color('red', 'ss h') | |
pymol.cmd.color('yellow', 'ss s') | |
pymol.cmd.png("%s.png"%(pdb_name)) | |
pymol.cmd.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment