Pymol2glmol

From PyMOLWiki
Revision as of 16:06, 16 January 2012 by Tlinnet (talk | contribs) (Created page with "{{Infobox script-repo |type = script |filename = pymol2glmol.py |author = Takanori Nakane |license = - }} == Introduction == A script to export a scene in pymol to GLm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Type Python Script
Download pymol2glmol.py
Author(s) Takanori Nakane
License -
This code has been put under version control in the project Pymol-script-repo

Introduction

A script to export a scene in pymol to GLmol. GLmol is a molecular viewer for Web browsers written in WebGL/Javascript.

With pymol2glmol, you can publish your pymol scene to a Web page. Visitors can rotate, zoom the molecule on the page.

Compared to export of polygon coordinates (VRML or Object3D), the published web page contain only atomic coordinates so that the file size is much smaller and visitors can even change representation.

Examples and script can be downloaded from my web page.

This script uses cmd.get_session to extract which representations is enabled on each part of the molecule. I think this technique is useful for many purposes, for example, writing exporters, copying representations between aligned structures, etc.

Comments and suggestions are welcome.

Best regards,
Takanori Nakane

Example of use

reinitialize
import pymol2glmol

fetch 1TQN, async=0
preset.pretty_solv("1TQN")
select heme, organic

pymol2glmol 1TQN