Tuesday, 15 February 2011

Using Kinect to control Jmol - Part I

A few weeks ago I showed a video of me appearing to control Jmol simply by waving my arms around. Now you too can appear to control Jmol in this way.

My instructions are going to be minimal, so your mileage may vary, but here goes...

1. Get a Kinect. You don't need to buy an Xbox. The Kinect costs about 150 euros.

2. Install all of the Kinect drivers and so forth. I'm on Windows and I followed the instructions by Vangos Pterneas (note that I needed to follow the "Troubleshooting" section to get things to work). Ben O'Steen was using Ubuntu at the hackfest and followed the instructions at keyboardmods.

If you did it all correctly, when you plug in your Kinect the driver should be found by Windows. If it isn't, just go through the instructions again.

Once the Kinect is installed, in your Windows menu try OpenNi/Samples/NIViewer - this should give the view from the camera and depth sensor. Also try PrimeSense/Samples/PointViewer to play with hand tracking.

Image: Creative Tools

Monday, 7 February 2011

The book stops here - Self-publishing in cheminformatics

Self-publishing, combined with print-on-demand, is something of a distruptive technology. It removes a huge barrier to publication, namely convincing a publishing house to take on your manuscript. Even if they do, for a book with projected low sales (for example, a book on cheminformatics), this usually means high prices and fewer readers.

With self-publishing, all you need is a PDF (or even Word doc), upload it over at Lulu (or one of the alternative self-publishing websites), and a couple of questions later your book is available for sale. No fee. And it's profit from the word go - a proportion of the cost of the book pays Lulu, and the rest goes into your pocket. Getting it listed on Amazon costs a few pounds, but it's also very easy to do.

I first heard about this in cheminformatics when Angel Herraez published the Jmol handbook (also available in Spanish) back in 2007. He makes the interesting comment on the book website that it's fairly easy for him to generate a customised version of the book for use on a course - I don't think that'd work with traditional publishing.

More recently, i.e. yesterday, Egon Willighagen published Groovy Cheminformatics with the Chemistry Development Kit. This covers the use of the CDK cheminformatics toolkit. The Groovy in the title is not the 70s vibe, but rather the Java scripting language.

Makes you think eh? What would you write a book about?

Update 13/02/11: The Cactvs Scripting Manual is also self-published with Lulu (see comment by WDI below).

Monday, 31 January 2011

Don't keep your cool - share it

At the PMR hackfest I met a number of people who were doing cool stuff...but I hadn't heard. Usually these things get posted somewhere and then, if sufficiently cool, they get shared around the web on FriendFeed, blogs, Twitter, etc. and everyone (interested!) finds out about them. But it has to be put on the web somehow in the first place...

Here's why you should tell people about cool stuff you're doing:
  • People want to hear about it
  • It's nice to hear that someone finds your stuff cool
  • It might be useful to someone
  • It's good publicity for you
  • Someone else might take your idea and do something even cooler

There are lots of ways of sharing this type of information. One of the easiest is a blog. If you think of a blog as essentially a cheap way to generate web pages you can see what I'm talking about. It takes about 10 seconds to set up a blog (at http://www.blogger.com for example) so there's no excuse.

As an example of something cool I found out about - about a year ago, Dan Hagon et al integrated TwirlyMol into Google Wave so that twirlying around was propagated by Wave action (the video explains all):

Thursday, 27 January 2011

Spellchecking a Sphinx documentation project

These are notes to myself about how to set up a 'virtual environment' to spellcheck a Sphinx documentation project. If you haven't seen virtualenv before, it's really great for managing separate environments of Python packages:
C:\Python26\Scripts\easy_install virtualenv
C:\Python26\Scripts\virtualenv docspell --distribute
cd docspell
Scripts\activate
python Scripts\easy_install-2.6-script.py Sphinx sphinxcontrib-spelling pyenchant
hg clone https://bitbucket.org/baoilleach/openbabel-user-docs docs
cd docs
REM Add "sphinxcontrib.spelling" to the list of extensions in conf.py
sphinx-build -b spelling . _build > mispelling.txt


In a feeble effort to add some chemistry to this post, here is a meta joke about cheminformatics (scroll right for the answer):
Q. What does a cheminformatician do if you tell him a bad joke?                                                                  A. First he SMARTS, then he SMILES.
(...my contribution to the International Year of Chemistry :-)

Tuesday, 18 January 2011

PMR Hackfest - Kinect the molecules

Two days + some smart hackers + two Kinects + one idiot waving his hands = ...

Credits: Ben O'Steen was our Kinect guru, and Dan Hagon and Sam Adams hacked support into Jmol with some pointers from Jmol devs.

Myself and Jens Thomas were working on Avogadro support but didn't make it happen in the timeframe. Marcus Hanwell is on the case though so hopefully it'll be coming soon to a computer near you.

Thanks again to Peter for the invite.

Blue Obelisk Lightning Talk and Poster at PMR Symposium

I've just come back from participating in the Visions of a Semantic Molecular Future symposium at Cambridge in honour of Peter Murray-Rust. I think I will have more to say on this later, but for the moment here's a copy of the lightning talk and the poster I presented on the Blue Obelisk.

As background, the Blue Obelisk group allows people with an interest in Open Standards, Open Source and Open Data in chemistry to collaborate, coordinate and have a few beers from time to time. Membership is very informal - just subscribe to the mailing list by following the links over at http://blueobelisk.org. If you're interested in changing the world and all that kind of thing, you might want to join up.



My lightning talk focused on Blue Obelisk projects related to interoperability. In the end, we were restricted to only 4 slides so the actual talk I presented was missing the CML slide and final slide.

Wednesday, 5 January 2011

Debugging vectors in 3D

Ever need to figure out the relationship between various 3D vectors? One way to do this is to draw the vectors using VPython.

When you run the following code using VPython's VIdle on Windows, an interactive window pops up where you can rotate the scene by holding down the right mouse button:
from visual import *

floor = box(pos=(0,0,0), length=4, width=4,
height=0.01, color=color.blue)
xaxis = arrow(pos=(0,0,0), axis=(1,0,0), color=color.green)
yaxis = arrow(pos=(0,0,0), axis=(0,1,0), color=color.red)
Does anyone know a different way to draw and interact with 3D vectors?