Sunday, November 22, 2015

Quick way to share interactive molecular structures and animations


Here is a neat trick I learned from @gyges01 on Twitter.  Say you want to share an interactive molecular structure or animation with someone not well versed in structural visualization tools. Here's what you do.

1. Put your file on a server like figshare and copy the link. For example: http://files.figshare.com/1860026/ethen_01oIRC.cml
Unfortunately, a dropbox link, which would have been even easier, does not seem to work. See below

2. Combine this link with "http://chemapps.stolaf.edu/jmol/jmol.php?source=":
http://chemapps.stolaf.edu/jmol/jmol.php?source=http://files.figshare.com/1860026/ethen_01oIRC.cml

3. Email (or Tweet) the link (takes a minute to load) with instructions to start animation: right-click > animation > play

4. You can autostart the animation by uploading a "dummy" xyz file with the commands: http://chemapps.stolaf.edu/jmol/jmol.php?source=http://files.figshare.com/2367420/ethen_test.xyz

ethen_test.xyz looks like this:

1
jmolscript: load http://files.figshare.com/1860026/ethen_01oIRC.cml; animation on; animation mode palindrome;
h 0.0 0.0 0.0

2015.11.23 Update Twitter strikes again: @aminophen found the trick to making this work with Dropbox.  Change https://www.dropbox.com/s/xxx/file?dl=0 to http://dl.dropboxusercontent.com/s/xxx/file.  Example:
https://www.dropbox.com/s/t42dx22mxsioja6/ethen_test.xyz?dl=0 to http://dl.dropboxusercontent.com/s/t42dx22mxsioja6/ethen_test.xyz and use it like before: http://chemapps.stolaf.edu/jmol/jmol.php?source=http://dl.dropboxusercontent.com/s/t42dx22mxsioja6/ethen_test.xyz



This work is licensed under a Creative Commons Attribution 4.0

No comments: