Sunday, 31 May 2009

Testing the Razors

As I wrote initially, I like the razors because they are easy to learn and use.
I have simulated two molecules only, because they are the standard (minimal) test I perform on simulation software. I come from the old school, where simulation means generating a plot from chemical shift values (while the razors mainly estimate the chemical shifts from the structure).
The first test is N,N-dimethylformamide.

1-H
exp. calc. diff.
8.019 1.609 -6.41
2.970 3.001 0.031
2.883 3.001 0.118

13-C
exp. calc. diff.
162.6 198.7 36.1
36.4 34.568 -1.9
31.3 34.568 3.3


The second test is ortho-dichloro-benzene.
Simulated by iNMR:
Simulated by HNMRazor:

Interview with Kevin Theisen

Kevin already told his story on the offcial website of iChemLabs. I was curious to know more details... Here is the first offical interview of my blog.
OS: How much accurate are the predictions of the NMRazors?
KT: The NMRazors are fairly accurate for most molecules. They will handle any molecule encountered in an undergraduate organic chemistry course. The NMRazors will be less accurate for molecules where complex anisotropic and 3D effects are present. I used several published references when developing the algorithms in the NMRazors and they are cited on the NMRazor website.
OS: Programming is similar to chemical synthesis: there are starting materials and finished products. What were the staring material for the NMRazors?
KT: When I first began programming chemistry applications, I started with a graph based depth-first search traversal of a database of reactions in order to optimize synthetic routes. A credible synthetic database was too expensive for me to obtain as an undergraduate, so I moved on to other applications in chemistry. I quickly discovered that the graph data structure is really integral to computational chemistry, as most chemical entities are efficiently modeled with them, especially structures. I was and still am a huge fan of spectroscopy, so I began to work on algorithms to traverse molecules and find functional groups for nuclear magnetic resonance simulations. It was originally a text based application, and I remember showing some of my favorite professors connection table inputs with ppm table outputs. It was very unattractive, so I taught myself Swing and the NMRazor GUI was created.
OS: Why do you prefer Java? Because of the language itself, the available frameworks, the platform independence or any other reason?
KT: Java is a wonderful programming language for several reasons. Mainly, it's object oriented and the graphical capabilities available with Java Swing are really unparalleled in other languages. The other reason was that I used a Mac, my friends usually used PCs and a few had Linux, so I needed a programming language that I could use on Mac and then deploy on other operating systems. Java was really the only choice for me at the time, given my minimal experience. The only downside to Java is that it is interpreted, so it may be slower if the program is carelessly written, and the JREs on different operating systems are not always consistent, so I still need to test on all three systems before I am sure a program actually works.
OS: How much work was required? What was the most difficult part: the algorithm or the interface?
KT: The interface was the most difficult part of the NMRazors because I was just starting to learn Java Swing. Now that I have pretty much mastered Java Swing, perfecting the algorithms is more difficult and takes far more time. But this is a good thing, because this saved time I can devote to truly perfecting the algorithms.
OS: Can you briefly describe the algorithms?
KT: There are two main ways to predict spectra, quantum mechanics and chemoinformatics. Quantum mechanics approaches calculate electron densities and then predict chemical shifts based on shielding. The NMRazors use a chemoinformatics approach, which takes a large database of spectra, defines similarity between the structures, and then interpolates to predict the chemical shifts of unknown species. Both can be very accurate if done properly, but quantum approaches take several hours. Since I couldn't afford a database of spectra, I went one level of abstraction further and used incremental constants to predict shifts. So the algorithm is similar to how a spectroscopist would predict a chemical shift in their head: they would look at the functional groups surrounding the nucleus of interest and add together the deshielding effects. There are other approximations for solvent effects, and splitting needs to be calculated, as well as second order interactions and more. These considerations make sure the simulated spectrum is as close to the real spectrum as possible.
OS: How do you manage to study and lead iChemlabs at the same time?
KT: There are days where it gets a little difficult. But fortunately, I have help with all the backend servers and services, web design, software testing, and of course accountants to do all the financials. Also, we were careful when we set up the company to put the appropriate infrastructure in place to manage our growth. Because we made sure to have redundant servers and source code control and bug reporting systems and product build processes in place, adding new products has become routine. Furthermore we outsource email and payment services so we just don't have to deal with those headaches. The bottom line, though, is I am very passionate about my company and my research. Currently, my research has become very exciting. It is a mix of chemical informatics and theory, which provide daily puzzles for me to solve. Both iChemLabs and my research push me to different edges of technology. Since I really enjoy both jobs it is not that hard to keep them both going. Every day I simply have fun with this stuff.
OS: You are marketing the razors for educational use. Could there be any practical use for them?
KT: My goal in my work is to provide quality software to students and scientists that is both accessible and affordable. The NMRazors were released for free for educational use because I knew it would be useful for students like myself that were working hard trying to interpret spectra for the first time. I also price our other software affordably so that I can continue to fund their development, without requiring customers to spend half of their savings. The NMRazors are used at several universities around the world now, and I am very happy with how this project developed.
In terms of practicality, as the algorithms mature over time, they will certainly be very useful to industry.
OS: Let's talk about ChemDoodle. How do you compare it against IsisDraw, ACD ChemSketch and Marvin?
KT: Firstly, I created ChemDoodle because I needed a very robust set of features, I could not afford ChemDraw, and ACD Labs would not respond to my emails when I requested pricing information.
Regardless, the chemical drawing software that was available was built on 10-20 year old systems that are severely out of date. ChemDoodle takes a new approach to drawing molecules, making the interface aesthetic and the controls more intuitive, providing functionality that takes advantage of current technology such as connections to online databases, and providing a more artistic approach to drawing figures by allowing users to completely control the look of structures including using different bond stroke styles for truly stunning graphics. ChemDoodle also contains many widgets, or mini-applications, which are added bonuses that perform very powerful and specific tasks. All these reasons are why I refer to ChemDoodle as a chemical structure environment, rather than just a chemical drawing tool like the ones mentioned.
Two years later, and we have succeeded in solving many of the issues other programs suffer from, and we work wonderfully on all operating systems. We receive emails almost daily complimenting us on our work and for creating a superior chemical drawing program, and we proudly agree.
OS: Are you going to write software for the iPhone? It seems like half of the world is doing it...
KT: That was a very attractive idea a year ago, when Brad Larson created Molecules. However, we are really focused on perfecting our desktop software and pushing ChemDoodle to be the best chemical drawing program in everyone's mind. We also have a couple secret projects that are under development, though not for the iPhone. These are brand new ideas, very different from current software, and we are sure chemists will love to use them.

Sunday, 24 May 2009

Unusual Solution

This is how I solved the problem of the razor.
1- I described the bug on my (this) blog.
2- It rang a bell into Kevin's mind;
3- Kevin recompiled both programs (1-H and 13-C).
It may sound difficult for you, yet recompiling a program is very easy (provided you are the author, it can be a nightmare in other cases!).
The new versions work and produce the desired plots.
I will return on the subject with more articles.
Thank you, Kevin!

We Insist!

Maybe there is an error into the drawing module, or I haven't understood how to use it.
Today I am going to bypass drawing with a clever trick. You can follow me step by step.
1) I open NHMRazor.
2) Command: Find Molecule.
3) I insert a molecular formula: C6H12.
4) I find 30 result: great! I scroll down the list and select 2-methyl-2-ene.
5) I click the button "Load". This loads the structure:
We have almost done it! Next step:
6) A click on the triplet icon.
7) This time I don't select any solvent (who knows?) and assume that the default settings are OK. Final step: button OK...
I am not showing the result because nothing has changed since yesterday ("The server has an error that is currently being fixed. Sorry for any inconvenience").
Have you ever played Myst? You know the feeling.

Saturday, 23 May 2009

A Picture from Kevin Theisen

Shaving with a new HNMRazor

The NMR razors are simple and (probably) powerful applications that can simulate a spectrum directly from the molecular formula. For the user's point of view it works like a (very) simplified version of ChemDraw. When you have finished drawing the structure, you hit a button to simulate the spectrum. When you hit the button, the program asks you such spectroscopic details like solvent, temperature, magnetic field, etc.. When you have finished this further step, the razor calls home. Yes, because all you have downloaded is a graphic interface, the true program is running into a remote and ultra-secret location.
I like this program because I have understood everything in 5 minutes.
To start with, I have simulated the 1-H spectrum of ethyl acetate in CDCl3, at 200 MHz.
Here it is:
Well, you know, I am not a lucky guy! Enough for today. If you want to try by yourself:
http://www.ichemlabs.com/content/nmrazors
This morning I shaved my face with a Gillette blue II. It is as good as a Gillette can be and it is much cheaper than the other models of the same brand. Officially it is disposable, yet I don't remember when I bought it. Quite likely I have been using the same razor for 3 or 4 months. As long as it works... Two complete reviews in a single post, I am very productive...

Friday, 8 May 2009

Off-Topic

I am not particularly inclined to blog in May.
Do you want to play with me?