How MestReC was born
Over the years, many of our users have asked about the history of MestReC and the early days. Now that we are celebrating the 5th anniversary of our company, Santi has already written in the Mestrelab blog about the birth of Mestrelab as a company, but this omits the early years of MestReC, which I will cover in the oncoming posts.
When I started the MestReC project, back in 1995, I was not really aware of all the consequences it would eventually have. At that time, I had just returned from England and had no clear ideas on what to do with my professional career. In principle, the most attractive option for me was to carry on doing organic chemistry research and to pursue a PhD as I had had a very good experience in that field in the group of Prof. Paul Jenkins in Leicester. However, my thoughts were so scattered that I even considered the possibility of earning a living playing drums in a rock band :-). Fortunately for the hearing health of many people, I soon abandoned that crazy idea and decided to keep my focus on the scientific arena.
And it was at the moment, whilst I was enjoying a period of pleasant procrastination, that Javier came to me to propose a devilish project for off-line NMR data processing and analysis which he named MestReC (more about the name in a moment). I knew almost nothing about signal processing (other than basic Fourier Transform theory) and my experience as a programmer went back to small applications that I developed in Pascal whilst at Secondary School. But ignorance is bold and, in this case, it turned out to be our best friend, because I was brave enough to accept the project. Needless to say that Javier was also quite reckless to trust someone like me to carry out such a project
Just before I continue with the story, a quick note on the name MestReC. This is an acronym for Magnetic Resonance Companion, as Javier was very insistent that the software should be very easy to use, a tool that would work on the data ‘with’ its users, helping them and accompanying them on the research journey. At the same time, ‘mestre’ means teacher in our local language, Galician, so the name also refers to the potential educational qualities of the software and to its geographical origin. As if fate had an input in it, of course, the C could also refer to the fact that the software was written in C/C++, but that was not the case initially and this consideration did not come into it.
Right after Javier introduced the project, and as an evident sign of silliness, I said, ‘yeah, no problem, this is something I can do in less than 6 months’. At the present time, after more than 14 years of development, I have come to the realization that it is a never ending project. Anyway, we still remember that memorable day back in late November 1995 when we saw for the first time an FID displayed on a DOS window after a few weeks trying to decode the cryptic data generated by our 250 MHz spectrometer equipped with an Aspect 2000 console. Funnily enough, we selected one of the most difficult formats to start off the project. The integer numbers were 24 bits long (3 bytes) with different byte ordering and the floating point numbers did not follow the IEEE 754 standard. But after some hacking around with some algorithms written in Assambly Language embedded into a Pascal application, we managed to create our first NMR data converter.
After that little but encouraging success we thought that the next step, Fourier Transform of the FID, should be something much simpler. Once more, our initial decision of using data from the Aspect 2000 turned out to be quite unfortunate in the short term as I will explain in a moment, but from my current perspective, I have to admit that it was a very beneficial circumstance as it forced us to ponder on our knowledge of the various protocols for NMR data acquisition and to delve deeper into Fourier Transform theory.
Without going into too much technical detail, the problem with the data set we were working with was that it required a real Fourier Transform (as opposed to a complex Fourier Transform) as the data was acquired in the so-called sequential mode (which means that the real and imaginary components of a complex value were not sampled simultaneously but rather one after the other using one single ADC). When we learnt all the tricks to transform a sequential FID, we produced our very first version of MestReC (version 0.1). It was of course a very primitive one, developed in Pascal (with those Assambly routines for data file parsing) which worked in DOS mode and , in addition to FT, it included basic weighing functions (Exponential and Gaussian) and manual phase correction. Obviously, it was intended for 1D NMR data only. Unfortunately, as the opposite would be great if only for nostalgic reasons, no part of this DOS/Pascal application has survived.
Of course, we knew that we would get nowhere with an application for DOS. It was precisely that year when Windows 95 rolled out and this appeared as a unique opportunity for us. Leaving all graphical enhancements aside, the greatest benefit we saw with Windows 95 was the 32 bit arquitecture which made programming of memory intensive software (such as NMR apps) much easier than 16-bit based Operating Systems (MS-DOS, Windows 3.x, etc). Well, I reckon that Windows 95 was not a 100% 32 bit OS, but for our purposes that did not really matter.
So we focused our development efforts on Win95. Another decision we had to take at that point was whether we should keep programming in Pascal, the language I felt more comfortable with, or rather switch to something else. I now remember that I spent a few hours in a library close to the Chemistry faculty taking a look at different programming books and I found a rather voluminous book by Charles Petzold titled “Programming Windows”. I decided to buy it and spend the Christmas holidays going through it. It was a great read and convinced me to learn and use C as the language for the new Windows 95 version of MestReC. This meant that I had to port the old Pascal code to C which basically consisted in starting the project nearly from scratch.
In a couple of months we managed to get a first prototype of the application working (BTW, this was possible thanks to the great support I got from Giuseppe Balacco, developer of SwanMR). In addition to supporting Bruker Aspect format, this new Windows version imported Bruker X32, Varian and Nuts file formats. As for its processing capabilities, it included basic tools such as different weighing functions (Exponential, Gaussian, Sine Bell), Fourier Transform of both sequential and simultaneous FIDs (real and complex FT), phase and baseline correction and some basic analysis tools (peak picking and integration).
To the best of my knowledge, this was the first Windows 32 bits (Win32) native application for NMR data processing. Despite being a very simple application, it soon turned out to be a very useful piece of software for many people, not just in our department, but also in several universities around the world.
More on what happened after this first release in my next post.


