diff --git a/Chimera_script/ReadMe.md b/Chimera_script/ReadMe.md new file mode 100644 index 00000000..746f951c --- /dev/null +++ b/Chimera_script/ReadMe.md @@ -0,0 +1,7 @@ +# scipt for generating Webgl images using chimera visulaization software +The script works on chimera software for visualizing pdb files of protein structures. +With this scirpt images of multiple protein pdb files can be generated in webGl format which is not yet avalaible in ChimeraX +Feel free to modify and add according to need + +## This is working with .pdb files in chimera software +Used in chimera terminal for python. \ No newline at end of file diff --git a/Chimera_script/webGL_images.py b/Chimera_script/webGL_images.py new file mode 100644 index 00000000..ebf61b46 --- /dev/null +++ b/Chimera_script/webGL_images.py @@ -0,0 +1,26 @@ +import os +import chimera +import Midas +from chimera import exports +from chimera import runCommand as rc # use 'rc' as shorthand for runCommand +# change to folder with data files +os.chdir("") + +# gather the names of .pdb files in the folder +file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")] + +# loop through the files, opening, processing, and closing each in turn +for fn in file_names: + rc("open " + fn) + rc("window") + rc("ac wb") + rc("roll") + rc("freeze") + rc("ac c2") + rc("wait 5") + htmlname = fn[:-3] +'.html' + exports.doExportCommand("WebGL",htmlname) + rc("close all") + + # save image to a file that ends in .png rather than .pdb + \ No newline at end of file