A library of chemlambda molecules

More than 400 molecules are now  available at the the github repository for chemlambda, at this link. Many of them have been used to produce the animations from the chemlambda collection at google+.

There are more than 200 animations in that collection, which attracted an average stream of 150000 views/day and more than 30000 followers. I am proud about that because the subject is rather hard and almost all posts contain original research animations.

If you want to identify the mol file (i.e. the molecule) which has been used to create a certain animation, then follow the  path:

  • click on the animation, you’ll be presented with a page where the animated gif runs
  • try to save the gif, you’ll see a name.gif
  • in another window go to the library of molecules and look for name.mol.

In most of the cases this works, but there might be rare cases where I forgot to preserve the correspondence between name.gif and name.mol.

During the time these animations have been produced, I used various versions of the scripts (all available at the repository). They should be all compatible, but it is possible that some mol files will not work as input for the scripts. If this happens, then it is because I used, mistakenly, a port variable in a bad place and then I forgot to delete the faulty version. Please excuse me for that, in case it happens (maybe, maybe 4 or 5 mol files from the about 440 are like this).

To see how to use the repository please go to the README.md file.

It is important to understand how I made the animations.

  • you need a linux or a mac, because the scripts are in shell or awk
  • I used a mac. I went to the folder where the scripts and the mol files are (so if you copy the mol files from the library, then copy  them in the same folder as the folder called “dynamic”, before you use the scripts). In a terminal window I typed, for example “bash quiner_shuffle.sh”. A list of all the mol files in that folder appear.
  • I type the complete name.mol and hit enter
  • then the main script does the magic and I obtain name.html
  • mind that the parameters for the computation are in the most important part, the script quiner_shuffle.awk (and quiner_shuffle.sh is just a wrapper of this, same for all the pairs of scripts .sh and .awk)
  • I used a browser to see name.html. Important: Safari works the best, by far, then Chrome. Firefox sucks for very obscure reasons. There is a solution for making the name.html to work on Firefox as well, is to find in the quiner_shuffle.awk the line “time_val=4; ” and to modify it into something like “time_val=120; “, for example. This variable controls the speed of the javascript animation, bigger is it, slower the animation.
  • You’ll see that the d3.js animation can take, depending on the molecule (and on the number of steps given by this line “cycounter=10000;” in quiner_shuffle.awk), from minutes to hours.
  • I made a screen capture of the animation and then I sped it, for example with ffmpeg.

Enjoy!

If you make nice stuff with it, then tell me and I’ll be glad to host your creation here and in the chemlambda collection.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s