Testing JSmol2wp

[jsmol pdb=’1LMB’ caption=’lambda repressor headpiece’ debug = ‘false’ wrap = ‘5’ commands = ‘arm = select 1-6:3, 1-6:4; color yellow;|||

helix-turn-helix = select 33-52:3, 33-52:4; color yellow; hide hoh;|||
helix 5 = select *:3,*:4; spacefill off; cartoon; select 84,87; color yellow;
spacefill on; select *;
hide hoh; hide *:1,*:2;
#moveto 2 0 1 0 0 0 0;
zoomto (84:4) 300;|||
DNA only =
display all;
hide protein;|||
Protein only =
hide all;
display protein;|||
DNA interaction =
hide all;
display 33-52:3, 33-52:4, 1-6:3, 1-6:4, *:1, *:2;
cartoon only;
select 40-52:4;
spacefill 23%;
wireframe 0.15;
color cpk;
zoomto (45:4) 300;

Last week we had a meeting to discuss enhancements for the department website. One thing that came up was the idea of better eye candy to highlight the research we are doing.  As a biochemistry department where many people are doing structures and structure-function studies, an obvious capability to add is a molecular graphics viewer. Fortunately, I had some experience through EcoliWiki with Robert Hanson’s Jmol project, which uses a Java Applet to embed viewers in websites.

Of course, the Jmol developers recognized several years ago that alternatives to Java were needed, especially for viewing molecules on phones and tablets that lack Java. As a Mac user, I also find Java to be problematic. So Jmol spawned a sister project: JSmol, based on javascript. Since I have some experience with writing WordPress plugins, I adapted JSmol for a plugin, which I call JSmol2wp.  Here’s what it looks like:

Dragging should rotate the model, which is embedded via a shortcode that passes a bunch of parameters, including the PDB accession, the caption, and code to create custom buttons and other interface elements. The buttons run Jmol scripts to select, zoom, recolor etc. The plugin detects multiple instances of the shortcode that creates the applets as long as they use different pdb accessions.

[jsmol pdb=’test’ caption=’This is the structure of the CynR DNA binding domain from a local file’ debug=false commands=’jmolCommandInput’ debug=false]