Skip to content

Commit b3633e0

Browse files
authored
Merge pull request larymak#132 from Avnam-ohri/main
Added a Chimera software script for generating webGL images
2 parents a6d2e29 + d3cb04b commit b3633e0

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Chimera_script/ReadMe.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# scipt for generating Webgl images using chimera visulaization software
2+
The script works on chimera software for visualizing pdb files of protein structures.
3+
With this scirpt images of multiple protein pdb files can be generated in webGl format which is not yet avalaible in ChimeraX
4+
Feel free to modify and add according to need
5+
6+
## This is working with .pdb files in chimera software
7+
Used in chimera terminal for python.

Chimera_script/webGL_images.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import chimera
3+
import Midas
4+
from chimera import exports
5+
from chimera import runCommand as rc # use 'rc' as shorthand for runCommand
6+
# change to folder with data files
7+
os.chdir("")
8+
9+
# gather the names of .pdb files in the folder
10+
file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]
11+
12+
# loop through the files, opening, processing, and closing each in turn
13+
for fn in file_names:
14+
rc("open " + fn)
15+
rc("window")
16+
rc("ac wb")
17+
rc("roll")
18+
rc("freeze")
19+
rc("ac c2")
20+
rc("wait 5")
21+
htmlname = fn[:-3] +'.html'
22+
exports.doExportCommand("WebGL",htmlname)
23+
rc("close all")
24+
25+
# save image to a file that ends in .png rather than .pdb
26+

0 commit comments

Comments
 (0)