Monday, 12 April 2010

Street View

I have discovered that my room is on Street View. The room from where I am writing now, from where I have written all my posts, where I have been working for the last 44 months is this one:
The next window at right leads to my bedroom.

Saturday, 27 March 2010

Cold War

Please find the similarities:

http://www.ansa.it/web/notizie/rubriche/english/2010/03/26/visualizza_new.html_1737522932.html

http://acdlabs.typepad.com/freenmrblog/


http://www.telegraph.co.uk/sport/football/leagues/premierleague/chelsea/7457982/Chelsea-v-Inter-Milan-as-it-happened.html


To tell the truth, I will always like Russian people because of Čajkovskij, Botvinnik, Tolstoj, Kramnik, Puškin, Šostakovič and I also like the Ucranians Lobanovs'kyj and Prokof'ev, the Latvian Tal', the Azerbaijani Kasparov... I even respect Putin more than Obama (without even mentioning our shameful and unpresentable Mr. B., of course). It is not in my nature to fight. Russians are free to do whatever they like with their own money. Sometime it looks obscene, sometime they find a Samuel Eto'o.

Friday, 12 March 2010

Two Promises

I promised a review on the DOSY Toolbox and the program itself is a promise too. It has only arrived at version 0.8, which is an explicit declaration: it is not completed yet. What could be missing? From my personal point of view, the documentation is largely incomplete. I can easily find out by myself how to perform the basic NMR processing (FT, phase and baseline correction, correction of the frequency scale, and so on), because I have continuously been doing these operations for 25 years with countless different computers. I feel lost when doing the specific DOSY processing. The meaning of the buttons looks clear. I have also read a few papers describing the scopes and the internal details of each method, but I still miss the general picture.
The ideal solution for a user like me would be a set of test spectra with detailed step-by-step instructions on how to process them to get the best results and, for the lengthy calculations, the time required. In this way I would have a tool to test if the version I have installed is free of bug (and properly installed) and at the same time a collection of tutorials.
What makes the toolbox rather unusual is the language used to write it, which is not C++ or Java or Python, but MATLAB. The consequences are that many operations are a little harder than usual. Examples are: starting the program, opening and saving a file, selecting a region, understanding if the program is idle or busy. These nuisances are mitigated by the facts that the program:
1) is free;
2) is cross-platform;
3) is the only alternative I can find in this price range;
3) can import and export the spectrum at any processing stage, so you are still free to use your preferred program for generic manipulations.
The one thing you'd better get used, if you launch the program from a unix shell, to is to look frequently at the contents of this shell during the execution of the toolbox, because many important messages are reported there. They can signal a situation of error, or explain why a command can't be executed, or simply inform you about the current status of the program.
The main window contains all the buttons for all the available processing functions. In practice the space allocated for the controls is larger than the area containing the plot. The latter can show only one selected row of the experiment (after FT). After the DOSY processing a second window appears with a contour plot of the complete DOSY map. The new window contains additional controls, most of them containing the word "plot" into their titles.
Nowadays I have a very large monitor, yet I can only work with the windows at their maximum sizes. I am a little worried about what can happen if you install the program on a laptop, because when I make the windows smaller I can't read the numerical values anymore (the fields are scaled down proportionally to the window, while the text size remains large, so I can only see the bottom parts of the digits).

It seems that, up to this moment, I have described MATLAB more than the DOSY toolbox itself, right? For the reasons I have reported, I could only try the simplest algorithm (HR-DOSY, mono-exponential) and the results are really great. The components of the (difficult) test that comes with the program are resolved. It is a mixture of sucrose, isopentanol and n-propanol. It is the same mixture shown on Journal of Magnetic Resonance (DOI).
During the last two months I have exchanged hundreds of messages with the author. It has been a painful and continuously interrupted work, because we had different computers and, more importantly, I have no copy of MATLAB. Each of us also had the usual urgent chores to deal with in the same period. I must admit I have been boring and annoying, often asking questions I could have found an answer to by myself. This slow torture has come to an happy end when we have created and successfully tested a file format (called DOSY Toolbox ASCII) to exchange data with other NMR programs, both in input and in output. It's enough that the other program is scriptable, and that you can read/write text files with a script. If these conditions are met, you can de facto use the toolbox as an external module of your preferred traditional NMR program.
Apart from the happiness for this extremely useful achievement, I have been the witness of the dedication and the kindness of Mathias Nilsson. I will remember with joy this collaboration, despite the several frustrating moments. We never met in person, so I identify the name Nilsson with the interface of the program and not with the face of the man. It is rather strange, even for someone like me that spends whole days in front of a computer. When the main window of the DOSY toolbox appears on the monitor, I feel like I am visiting a new friend of mine.

Thursday, 14 January 2010

Men at Work

As soon as I began experimenting with the DOSY toolbox I was surprised to discover an unexpected hole, which is just a novel proof of my old theory on NMR imprinting.
If your first spectrometer is a Varian, you will become a certain kind of spectroscopist and a certain kind of programmer. If your first instrument is a Bruker, you will become a different spectroscopist and a different programmer.
If a brukerist programmer had written this toolbox, he would have imported the frequency domain spectrum and started from there. Mathias Nilsson is instead a Varianist and he imports the FID only. We talked about it and now he agrees with me on the importance of importing and exporting the data to and from as many programs as possible. For example, I might prefer using an external software for the preliminary processing (FT, phase and baseline correction), then the DOSY toolbox for the separation of components, eventually a third software (or the first one again) for printing, visualizing, creating slides, etc...
This is not really efficient, because in many real cases I probably want to try with different preliminary processing (e.g.: apply or remove a line broadening), and this is already easily done with the toolbox, but becomes cumbersome if I move data from an application to another at each stage. The principle is, however, to let the user choose whatever he prefers.
This kind of transfer is the less problematic one: the information is not to be stored, not to be transmitted, is consumed on the spot on the same machine that generates it. I and Mathias have already started collaborating on this and, if only we were better programmers, we had already finished by now, but this is not the case.
Unfortunately, we are equipped with two different brains, and it has a price: countless emails to explain each other what we need, what we can do, how we would solve a given problem. It's really a case where it takes more to explain a thing than to do it.
In practice, we have created a simple, highly readable, redundant file format that consists into a text file, like JCAMP-DX, but without compressions of any kind. At the same time, we are testing this format on the field. I am writing two scripts (the language is Lua) to export data from iNMR to the DOSY toolbox and to import data back again.
We have chosen this approach because I am the prototype of the average ignorant. If I am able to write these scripts for at least one external program, this can be categorized as an easy task, whichever other program you want to use in combination with the DOSY toolbox, the only requisite being that the program must be scriptable.
Now you know what I have been doing during these days and why the promised review is not ready yet. To tell the truth, I don't know why I should write a review in a case like this, where the source is open and the author is so collaborative. I mean: if I find something that I don't like, it's more productive to talk about it directly with Mathias Nillson than to spend a day to write a review.
Generally speaking, I don't believe in open source, I don't see how it might work. Pick any example of a moderately large project: how many people can safely modify it? Normally, it's only the original author. In practice, it makes little difference if the source is open or not.
In this particular case, the software is written with MATLAB, which I haven't, but it would be the same if it was written in a language I am familiar with.

To be continued...

Thursday, 7 January 2010

Installing the DOSY toolbox on a Mac

The DOSY toolbox is an open source program written by Dr. Mathias Nilsson that runs on Windows, Linux, Mac and on any other platform covered by MATLAB. I am going to review it next week, while today I am giving a few practical tips that I prefer to leave out of the review, for the sake of readability and tidiness.
I know that 14% of my readers have a Mac, and I have verified that the original installation instructions of the toolbox are inaccurate and unclear (for the average Mac user at least), so today I will simply explain how you can install the DOSY toolbox on your Mac.
Download the file called DOSYToolbox06_MAC_13May09_pkg from the address:
http://personalpages.manchester.ac.uk/staff/mathias.nilsson/software.htm
With a double click this archive generates a folder called: "DOSYToolbox06_MAC_13May09_pkg 2". This name is actually too long and useless, therefore I have shortened it into "DOSYToolbox06" and moved the folder inside my home directory. This is not strictly necessary but is a safe and sensible move. Inside the folder there is an installer called "MCRInstaller.dmg". It installs the runtime of MATLAB, which is necessary (unless you already own MATLAB itself). The difference is... technically speaking... to make it short... well the difference is $2,000 that you save if you install the runtime instead of buying matlab itself. Got it? A little slower but much cheaper.
The installer works like any other installer: you must always say "yes", you can't be wrong, eventually you will read it's all OK but you have no clue of what it has done and this is terribly bad because you absolutely need to know where the files have been installed, otherwise you can't run the DOSY toolbox at all. Fortunately I have discovered where the files have gone:
/Applications/MATLAB/MATLAB_Compiler_Runtime/v710
(this is valid, of course, for version 7.1 of the runtime).
The downloaded folder also contains a script called: "run_DOSYToolbox06_MAC.sh". This is the command that starts the program, and it needs an argument and this argument is the path to the matlab runtime that you have already installed. In other words, the canonical way to start the toolbox would be to type a command like this into the Terminal:
/path/to/run_DOSYToolbox06_MAC.sh /path/to/MATLAB_Compiler_Runtime/v710
for example:
/Users/your_name/DOSYToolbox06/run_DOSYToolbox06_MAC.sh /Applications/MATLAB/MATLAB_Compiler_Runtime/v710
This is highly impractical, but you can easily create a double-clickable shortcut:
- open the Automator application
- choose the template called "workflow"
- into the leftmost column, click on "Utilities"
- into the second column, double click on "Run Shell Script"
- from the pop-up menu "Shell" choose "/bin/bash"
- fill the main field with our command:
Run this workflow. If, in a few seconds, the DOSY toolbox window appears, it means that the workflow works. Quit the DOSY toolbox and save the workflow. Be careful and select the proper File Format: it should be "Application" and not "Workflow".
Finally you have created a double-clickable application (you can paste a different icon)
and you can forget Terminal, shell, bash and the likes...
At the time of this writing, though, it seems that the DOSY toolbox is fully functional only if launched from a shell. It is a puzzling and unwelcome incident, I hope it's going to find a solution soon.
Has anybody the compiler for the Mac? Would this person be so kind to compile version 0.7 for the rest of us Mac users? "Open source" means that some times you should also give, not always take.

Wednesday, 2 December 2009

Jake Bundy

What's your position and where are you working?
For the past 5 years I have worked as a lecturer in Biological Chemistry in the section of Biomolecular Medicine at Imperial College London.

Where have you been working before?

Before this, I post-doc’ed at Cambridge; before that, UC Davis; and before that, for my first post-doc, at Imperial College again.

Briefly describe your research.
I am interested in metabolism in invertebrate and microbial species, and how this is involved in several different biological questions. Some of the projects I currently work on include microbial virulence and pathogenesis; how metabolism is affected by problems with recombinant protein folding in the bioprocessing yeast Pichia pastoris; and using earthworms as biomonitors of environmental pollution.

What do you use NMR for?
Together with mass spectrometry, I use NMR for metabolite profiling, as part of the technology for metabolomic studies. Although it’s generally less sensitive than mass spec, NMR still has a very useful role – as a near-universal and robust detector, it can give a quick and information-rich spectral profile. Most of the work we do, we just use 1D NMR for profiling; particularly useful for studies where you want to process as many samples as possible. However there are also other cases where more in-depth NMR experiments are needed, for example for isotopomer analysis to investigate metabolic fluxes; or to assign novel metabolites (essentially a natural products chemistry problem).

Which NMR software are you using?
XWIN-NMR and Topspin for data acquisition; iNMR for all NMR processing. I also use Chenomx NMR Suite for helping assign and quantitate metabolites in NMR spectra.

Which other NMR software have you used in the past?

I’ve also used VNMR and ACDLabs NMR software, and MestreC (before it was released as a commercial product).

How do you rate iNMR?
iNMR is not only my favourite NMR software for Mac OS (I’m not sure how many competitors there are at the moment), but it’s easily my favourite NMR software full stop. It’s one of a handful of Mac-only packages that I use all the time as part of my regular working day (others include Papers, Aabel, and Bookends). Features that I particularly like include the Overlay Manager (which makes it by far the quickest and easiest NMR software to use for comparing multiple spectra, in my opinion), and also the overall simplicity of using it to produce quality spectral images that can go straight into a paper or presentation without having to use multiple machines or virtualization. I admit I wasn’t really bothered by lack of anti-aliasing on spectra before using iNMR, but now I’m used to it, I do find it genuinely annoys me when looking at spectra in Topspin, say – it’s distinctly harder to see fine detail without zooming in. It’s also elegant and quick – not essential properties for software, but makes it more enjoyable to use on a regular basis.

Is it enough for your needs?
Well, it’s certainly enough for my needs in the sense that all of the spectra that I acquire are processed with iNMR – so in one sense, yes, almost by definition. It’s not 100% perfect though, there are still some small issues that could be ironed out in future releases – and as I’ve already said, I do use Chenomx software for some complementary uses which iNMR isn’t primarily designed for. I definitely see it as a crucial part of my workflow for the foreseeable future though, and expect it will keep improving (although by now it’s a relatively mature product).

Hands on 3-D Processing

A measure of the computing power available today with a desktop computer is the possibility of processing huge spectra in real time. For example: is it possible to correct the phase of a 3-D matrix interactively, in real time? The answer is: yes and you don't even have to employ more than a single core nor to buy an high-end graphic card. When I mean interactive processing I mean that:
- you see a graphic representation of the matrix at each processing stage.
- you can play with it, for example change a parameter just to see the effect it has on the matrix.
It is always necessary to know and understand the mathematical rules that govern NMR processing. The more you know them the more you enjoy their visual representations. The more you play with the graphics, the more you understand the maths behind. The two things go together.
You can find a self-teaching course on basic 3-D processing on the iNMR web site. There is no theory, only a lot of examples and a good measure of practical tips.