Thursday, 27 December 2007

Wizardry

Simplicity and the management of my spectroscopic data. This is all I ask to NMR software. Increase in resolution and sensitivity is something that I expect from advancement in hardware. Progress in the software field requires little time. If something was possible, somebody already did it. If nobody did it, it means that it was not possible.
Even an ignorant can increase both resolution and sensitivity, simultaneously, thousands of times or more. It's enough to use a non-linear method. Suppose you have an ugly spectrum, like this:

I don't know what it is, it's the first spectrum I have found today. Suppose I know, instead, what it is. I may be certain that they are two triplets. I can perform peak-picking, retain the 6 highest points, then create a synthetic spectrum containing 6 perfect lorentzian shapes, with line width = 0.1 Hz and noise = 0. Maximum resolution and maximum signal/noise.

Non linear methods work like this. Either they filter out all signals below a given threshold, or they select the given number of highest signals. It's risky, unless you already know what to expect (if you know everything, however, there is no need to collect the spectrum). If you need elegant presentations, you can get them with software. Increased knowledge is a different thing.
What does not work in general, can often be the perfect solution in some special cases. At the beginning of the year I mentioned the Chenomx Suite of programs. They require reference deconvolution to be applied as a pre-treatment on every experimental spectrum. Reference Deconvolution is an ancient trick that never found widespread implementation. After years it has found a reason to exist. Linear Prediction is a technique that emerged in the 80s. Its purpose was to extract the NMR parameters from the FID avoiding both FT and spectroscopic analysis. Nobody was using it. After a decade it found a different application: it allowed shorter acquisition times for HSQC and similar experiments.
Research in the field of NMR processing is precious, but I don't expect it to change the whole field. It can find specific solutions to specific problems.

Automatic and Manual

Automatic methods are good: they accomplish a task for you. Manual methods are twice better: you have the job done _the_way_you_like_it_ and, at the same time, you are acquiring a skill.
If you have ever tried to shim a magnet, you know that manual adjustments can be discomfortable. For example, shimming an aceton solution is not as simple as shimming a DMSO solution. Trimming Z1 alone is simple, but optimizing 10 gradients is more time consuming, to say the least, etc... In summary, there are many reasons why manual methods can become unpractical: long reaction times; mutual dependence of the parameters to be adjusted; extreme distance from the optimum; weak response.
These reasons have often been removed, in the field of NMR processing. Twenty years ago, when there weren't so many automatic methods, manual processing was painful and time consuming, but there was no alternative. Today's programs are so automatic that don't even ask you if you want your spectrum processed. They do it and that's all. Vendors say they save your "precious time". How much time? Not more than 1 minute, I guess.
Manual methods remain more flexible and precise. Thanks to faster computers, (rare) faster software, improved graphics and peripherals and increased knowledge, the reasons why manual methods used to be cumbersome and frustrating have been removed. Tomorrow's manual processing has little to share with past experiences... unless nobody cares. And it seems that nobody cares! Automatic methods have far more marketing potential, that's for sure.

Wednesday, 26 December 2007

Consequences

This year has been the year of NMR blogs. Today I am introducing the most recent ones.
University of Ottawa NMR Facility Blog
"A blog for the NMR users at the University of Ottawa" is written by Glenn Facey. It's the most frequently updated blog, at this writing moment. Despite the name, is useful to beginners involved with practical NMR spectroscopy, wherever they are based, not only at the University of Ottawa. Expert spectroscopist can as well find several useful posts. There are links to other NMR resources on the web, many clear pictures to make the concepts clear, processing tips and suggestions for useful pulse sequences.
The home page contains the customary exchange of courtesies with other NMR blogs. At the top of the list there is Carlos' NMR blog which is very recent indeed (it didn't exist at the time of my last post).
Carlos is a friend of mine since 1996 and was already active in the field of NMR software at that time. The title of his blog is "NMR Analysis (Processing - Prediction - Verification)". Doesn't it sound as a replica of my own blog? Wrong, it's a completely different thing! I'll explain why at the end.
Carlos' blog has already received its dose of celebration, justified by the fame and of the competence of the author. The first 7 posts have been impeccably prepared, yet, IMHO, it's been a false start.
Carlos is always busy. Not only he's continuously inventing new amazing algorithms, he's also writing a commercial NMR program, is the president of a company, attends countless conferences and, like most of us, has a family and a couple of hobbies. Do you believe he started a blog to defeat the boredom? He felt the need to bring to the public attention his latest inventions, but can't afford to enter into the details, not only because time is short, but also because he is reserving the details for the usual scientific articles. During the years Carlos has always shared his inventions with me. I have found a few of them extremely useful and included into my own programs. Not all of them, however, because he invents a lot of algorithms. Even when they are useless (IMHO), they are still a source of inspiration. Sometimes it happens that the inner workings of the method are the only things that interests me, because the results are discouraging. Other times I am amazed by the results, while Carlos is frustrated because he has found a rare exception that makes the method inapplicable in 1 case over 1 thousand.
Up to now the blog has proposed two novel methods to the general public, without disclosing their mathematical basis. I have already commented on that blog why both methods can't be included into any processing routine, therefore I will not repeat myself here. It would have been more useful and wise to present two old and established methods, possibly written by somebody else (the literature is, already, mostly made by people that praises themselves, why can't we have third party criticism anywhere?), but Carlos only has the incentive to write about his own latest inventions. Eventually the new blog is similar to Ryan's blog (the difference being that Carlos is a programmer while Ryan is not). My impression is that Ryan started a blog because he was afraid of what Carlos was doing and Carlos replied with another blog because he was worried by what Ryan was writing. I am certain they will say I am a fool to think such a thing. What's your opinion?
Ryan has clearly stated that his blog will deal with his own products exclusively. Carlos has promised more variety, but up to now has delighted us with pictures taken exclusively from MestreNova. Apart from my worthless impressions, I have a couple of opinions that put me apart from the other bloggers and the rest of the world too. First: We don't need automatic processing. Second: I am not expecting miracles to arrive from software. These will be the subjects of my next two posts.

Friday, 16 November 2007

Where Has 2D NMR Gone?

2D NMR is more than 30 years old (the original idea has been traced back to 1971). Initially developed during the 70s, it was brought to the masses at the end of the 80s. By then the newest spectrometers were already providing shortcut macros. With a single command it was possible, for the novice, to acquire, process and print a COSY, with another macro she could acquire an hetero-correlated experiment, etc.. Simplicity was necessary to attract the masses, but fashion was important too. Everybody experimented with 2D spectra, but they soon discovered it was too early. Computers were not fast enough. The proliferation of pulse sequences (most of which already forgotten) was confusing and neither phase sensitive spectra (unmanageable with slow computers and non-interactive software) nor magnitude-mode spectra (resolution-deficient and sensitivity-deficient at the same time) were satisfactory. The single exception was the COSY experiment: simple, robust, fast, informative, easy to run and easy to process. Its only possible drawback: it is out of fashion. Compare the COSY to a 1D spectrum: no need for phase correction. In most cases baseline correction and integration can also be skipped. Weighting is required, but you can always use a sine bell and give it no thought. In other words, not only COSY is the most useful and simple 2D experiment, it's also simpler than any 1D spectrum. Today's gradient-enhanced version is also as fast to acquire as a 1D spectrum. I don't mean that you must acquire it in all cases. Actually, it's an overkill in most cases. When only two multiplets share an identical coupling constant, it's obvious that they are the coupling partners of each other, you need neither the COSY nor the homo-decoupling. Most of the information is already available into the plain, 1D, proton spectrum. Let's say that the COSY is only required for 20% of your compounds. It's still a consistent number of 2D spectra, by the end of the year.
Look at this movie. The young chemist that you see at the beginning and at the end was born after 2D NMR. You'd expect she's at ease with it. The video is instead about a new product devoted to the semi-automated analysis of 1D spectra only. What happened? The guys at ACD Labs have recycled a few pieces of their code and created a new attractive product, called "1D NMR Assistant". It's encouraging to see new ideas in the field of NMR processing (although the ingredients aren't new, the overall concept is). There's another movie into Ryan's blog and others are coming. They save me the effort to actually try the program itself. I will cite a few sentences from Ryan's.
ACD/1D NMR Processor...can sometimes be viewed as bloated, and overly complex for a novice or non-expert user.
You are saying it! And you haven't even mentioned the 2D Processor! The 1D processor is already bloated by itself, according to you.
From the very beginning, we were developing a product with the NMR Spectroscopist in mind.
I can't buy it. From the very beginning the name of the company was "Advanced Chemistry Development", not "Advanced Spectroscopy Development". If you really had the spectroscopist in mind, why you removed 2D?
We have just de-emphasized some of those features in the software in an effort to greatly simplify the toolbars and interface. I believe that we reduced the learning curve significantly.
Admirable effort. It's a relief to hear somebody else recognizing what I am repeating from a lifetime: too many icons don't make an easier-to-use program.
The ultimate motivation behind this product was the simple idea that, "an NMR spectrum is a means to an end"
What's the end? Please don't conclude that the report is the end (the movie doesn't say such a thing). Anyway: the assistant can create the report from the spectrum even when the chemist understands the bare minimum.
There is nothing available that really helps users evaluate and interpret an NMR spectrum and it's relationship with a chemical structure. That is until now, IMHO. I think the development of ACD/1D NMR Assistant changes all that.
It changes that, but not all that. In the movie all the multiplets are isolated.
In my practice this is a rare circumstance, but evidently my compounds were more complicated than the average.
This product wasn't just built by a few software-oriented people within ACD/Labs.
We already know you are a chemist.
Over the next few weeks, I will be highlighting different features and workflows in the software to educate you on how it works and what it does.
This leaves me the burden to educate you on what it does not.

The assistant assumes that any multiplet can be analyzed regardless of the rest of the spectrum. It's the so-called "first order approximation". The lower the magnetic field, the less frequently this approximation can be applied. What happens in the remaining cases? If you recognize that there is strong coupling, either you resort to second-order analysis or you renounce to extract both the coupling constants and the chemical sifts (reporting a range for the latter). If you don't recognize it, the extracted parameters will not be accurate.
A spectrum subjected to strong coupling is not necessarily complicated. Look at this familiar AB pattern. Everybody knows the rule: the J corresponds to the splitting, while the chemical shift corresponds to center of mass of the doublet (not to the average position!).
Another celebrated case is represented by the ODCB. Here you really need to perform a generalized simulation, taking all signals into account. These cases are rare indeed, but if you are serious about extracting NMR parameters you can't avoid quantum mechanic forever.
In one of the videos (the first one the blog, Nov 15) the assistant fails, at first, to extract the Js from a triplet of triplets. Then Ryan manually peak-picks two shoulders and feeds them to the program, which eventually succeeds. That's great, but can you always do without a line-fitting deconvolution? What's more, the example highlights the importance of the visual inspection. In the old days of CW NMR, the spectrum was plotted on a large sheet, similar to the A3 format (as we call it here in Europe). When I look at the ACD reports, where the actual plot is reduced to little more than a thumbnail, I wonder: "Do they observe them with a magnifying glass?". Of course the user is free to print magnified plots and this is not a terrible limitation, but what about the rendering on the screen? A few months ago Ryan admitted that his software was not as good-looking as the alternatives on the market, from which I concluded, erroneously, that the next version of his software would have filled the gap. No way, the graphics are still aliased, and, believe me, it was a little painful to see those movies. It brings you a decade back. When you get used to anti-aliased graphics, like in my case, you can't go back. Here is the aliased version of my previous ODCB picture.
It contains a good measure of shoulders, and they are all artifacts. While it's normally possible to discriminate authentic shoulders from fake ones like these, through a torture for your eyes, today we have eliminated the fake shoulders altogether. Anti-aliasing is implemented in hardware, not in software. Your graphic card is already capable to draw as shown in the first two examples. Those more advanced applications that draw better are doing nothing more than allowing the graphic cards to do their work. ACD Labs found the time to reassemble their old routines into a new attractive package but did not find the time to bring their drawing routines into the third millennium. What a pity!
Do you know what else is missing? 2D spectroscopy. Maybe next year they'll be offering you the 2D NMR assistant...

Monday, 5 November 2007

Anniversary

The first anniversary of this blog has come and quietly gone, without celebrations. I started writing it to fill an empty slot in my working activity (I was waiting for a new computer to arrive and could do nothing better than a blog without it). I had many (unordered) ideas to share and started putting them down, like writing a book but without a plan. Then the moment arrived when I had no more useful things to say and no more time to write them down. Afterwards different days arrived and the book became like a diary.
I haven't convinced anybody yet to join the forces and cover those large areas where my ignorance can't arrive. Neither I have convinced any people to change their NMR software. It seems that at least half of the chemists are still happy with the software that comes with the spectrometer. If you, like Ryan, are convinced that things are different and the future is bright, why don't you switch job and start selling NMR software (or creating it)?
In the world of computing 2007 will be remembered for the introduction of Vista and the iPhone. What happened in the world of NMR has received less press coverage, therefore I don't know it. In the intersection field of NMR software, the year has obviously been marked by the release of MestreNova. The 3 things (Vista, iPhone and MNova) were announced with too much anticipation and preceded by too much hype. While Vista is just another OS and the iPhone just another expensive gadget, everybody will agree that MNova (this is how they call it now, informally) is a very welcome improvement over Mestre-C. A more significant improvement than that represented by TopSpin (compared to XWin-NMR).
What do MNova and TopSpin have in common? Both programs have already become _partially_ obsolete. TopSpin is still incompatible with Vista (after 1 year! unbelievable!). People at Bruker are not terribly worried by this fact because, historically, their software was developed on Unix (Uxnmr -> Iris -> RHL), and the Windows version has never been the main version. Bruker stated that they are working had to make TopSpin run on Vista, but it will be a lengthy and difficult task.
MNova is already incompatible with Leopard, the new Mac OS released 10 days ago. The problem is negligible, if compared to the one of Bruker. The friends at MestreLab had not cared about it until the Leopard really materialized on the shop shelves. At that moment, they were already into the advanced stage of their current development cycle. They say that the next release will still be incompatible, while the release that will come next will certainly be compatible. What it means in time units is less clear. It seems like they are releasing a new version every 3 months; just a rough estimate. They shouldn't be worried because they can't make much money within the Mac market.
Quite sadly, SwaN-MR, the free software that gives the name and the picture to this blog, can't run neither on Vista nor with Leopard (nor on Linux, Solaris, XP, etc...). To use SwaN-MR you need a PowerPC Mac with Tiger (or older OS). This blog has been accused of promoting iNMR, but it can't be so. Look around this page. Do you see any iNMR-related banner or link? There aren't, until this point, so let me create one of them on the spot.
I've read that two million people have already upgraded to Leopard and many other million will follow in the next months/years. They can already process their NMR spectra today with iNMR 1.8. It's not free, but costs € 79 (it's worth ten times more, let me stress it). It's better than the software you often find installed on spectrometers. It's optimized for both the PowerPC and the Intel Core Duo. Leopard is not a requirement: iNMR also runs on Panther and Tiger.

Sunday, 28 October 2007

Kirk Marat on Spinworks

I came across this blog while browsing the web. I am the author of the reviewed software and just want to make a few comments, describe the reasons why some things were done the way they were done the way they were, and describe where the software is headed.

First of all, let me say that I very much appreciate the comments. I find that when people tell me what they don't like about the software that this is the most important feedback for making improvements.

Regarding polynomial baseline correction: All poylnomials curve to one end or the other. Most NMR spectra require only very low order correction or, at least for proton spectra, have more curvature at the right end. I have only encountered a very few cases where I have had to reverse the spectrum, correct the baseline, and then restore the original orientation. So few cases, in fact that I haven't been motivated to have a polynomial option that has increasing curvature at the left. SpinWorks 3 will have a cubic spline baseline correction as well as a polynomial. For spectra withe severe baseline curvature I tend to use backwards linear prediction. For baseline offset, adjust first point multiplier.

>> "No other NMR program asks such a thing." Actually, the interactive polynomial baseline correction in UXNMR/XwinNMR requires exactly the same operation. Not sure about TopSpin.

The parameters for simulation were split into three dialogs for one main reason: The number and labelling of the couplings depends on the definition of the spin system (including symmetry and multiplicity) in the chemical shift dialog. If shifts and couplings were in the same dialog, the labelling and number of the coupling constant boxes would have to be updated with each edit of a shift. The current coupling dialogs look at the spin system definition and dynamically generate the proper number and labelling of the boxes. I guess the J and D coupling boxes could be combined, however.

I actually asked users whether they wanted automatic update of a simulated spectrum after editing the spin system parameters. The almost unanamous verdict was no! Most found the calculation delays at the closing of the dialogs annoying, especially for bigger spin systems. This was in the days of slower computers, however. I will consider adding an option for autoupdate of simulated spectra.

I was surprised at the finding of crashes during 2D processing. 2.5.5 is generally pretty stable at general 2D processing. Can the reviewer send me a description of the problem and some sample data?

Yes, the automaic phase corection sucks! Automatic phase correction is actually quite difficult and I just haven't had time to get a come up with a really good algorithm yet. The problem is generally with sparse digitization and baseline offsets and curvature. I have also noticed that neither the Bruker nor the Varian autophase routines work perfectly either although, from what I have observed, Bruker's seems to work a bit better than Varian's.

The "initialization error" seen with SpinWorks 3 simply means that release 2 of the .NET framework is not installed. This is an easy download and install from MS, and is also included on the SpinWorks ftp site. The install program for the latest SpinWorks 3 beta actually tests for .NET 2 at install time, and stops the installation until it is loaded. I have switched from Installshield to the Windows Installer for the installation. .NET is the future of MS software and should, in theory, produre a platform independent program. Any OS that supports .NET should run the software. There has been some initial, if not complete, success running SpinWorks 3 under mono on Linux. Unfortunately, the .NET level in mono is not quite up to the MS version yet.

In the initial MFC version, the tools provided for a "Single Document Interface" or a "Multiple Document Interface". Although it would be possible to use the MDI for NMR spectra (MestRC does) it is complicated because NMR spectra, especially 2D spectra are MUCH more complicated objects than the "documents" envisioned by the MFC designers at Microsoft. Microsoft has abondoned the "document/view" SDI/MDI ideas used in MFC. They are no longer supported in .NET I will be adding "multiple workspaces" to SpinWorks 3.

"If you need to simulate a spin system, consider also gNMR (abandon-ware)." I happen to know the author of gNMR, and he and his students are now using SpinWorks for much of their routine NMR processing.

Cheers
-Kirk

Tuesday, 16 October 2007

10-Q

Many times I have written about the price of NMR software, but rarely reporting the figures. At the cost of becoming boring (and of making the happiness of Ryan), I want to add another post in the vein. Yesterday I stumbled upon an old document of no value: a Quarterly report of Accelrys to the SEC of 1998. It's old to the point of becoming misleading. There you can find the prices in yen for the Japanese market in 1996 and the equivalent in dollars. I am reporting the latter only. They are unbelievable:
  • Felix-ND: $ 30,000
  • Felix-Assign (additional module): $ 30,000
  • Felix-Model (another module): $ 15,000
  • NMR Compass: $ 25,000
  • NMR-Pipe: $ 30,000
  • NMR Refine Complete (requires Insight and Discover): $ 60,000
  • NMR Structure Determination (requires QUANTA): $ 23,000
All the notes within parenthesis mean that you need to spend another amount of money before you can use that product. Don't forget that the value of the dollar has decreased a lot since then! I want to know who bought at those prices and, most of all, I want to hear from them if they would do it again today.
They can't, anyway. There are no NMR products in the present listing of Accelrys. A curio: Joachim Sauer (Angela Merkel's husband) worked at the company. It looks like a spy-story, involving the STASI and the CIA. Read it here in English. The same news can be found in other languages on the web.