Skip to content

Added a Chimera software script for generating webGL images #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Chimera_script/ReadMe.md
Original file line number Diff line number Diff line change
@@ -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.
26 changes: 26 additions & 0 deletions Chimera_script/webGL_images.py
Original file line number Diff line number Diff line change
@@ -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