{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "chem-bla-ics",
  "description": "Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.",
  "home_page_url": "https://chem-bla-ics.linkedchemistry.info/",
  "feed_url": "https://chem-bla-ics.linkedchemistry.info/2008/06/04/recovering-full-mass-spectra-from-gc-ms.json",
  "icon": "https://chem-bla-ics.linkedchemistry.info/assets/images/chem-bla-ics_logo.png",
  "language": "en",
  "authors": [
    {
      "name": "Egon Willighagen",
      "url": "https://orcid.org/0000-0001-7542-0286",
      "_orcid": "0000-0001-7542-0286"
    }
  ],
  "items": [

    {
      "id": "https://doi.org/10.59350/r7fav-92885",
      "url": "https://chem-bla-ics.linkedchemistry.info/2008/06/04/recovering-full-mass-spectra-from-gc-ms.html",
      "title": "Recovering full mass spectra from GC-MS data",
      "content_html": "<p>One aspect not covered in detail by the <a href=\"http://wwmm.ch.cam.ac.uk/blogs/murrayrust/?p=1134\">ongoing</a>\n<a href=\"http://wwmm.ch.cam.ac.uk/blogs/murrayrust/?p=1133\">discussion</a> on <a href=\"http://www.simbiosys.ca/blog/2008/06/03/research-and-software-testing/\">unit</a>\n<a href=\"http://www.simbiosys.ca/blog/2008/06/03/quality-in-chemical-software-the-debate-continues/\">testing</a> quality control for scientific software,\nis detecting regressions. This is the most important reason why unit testing is superior to random testing. Putting someone behind a\nkeyboard to tests things is nice, but this process has to be repeated, as the testing has to be repeated over and over again. Just\nto make sure it works for whatever new input, for whatever refactoring, for whatever new cool feature.</p>\n\n<p>Another advantage of unit testing over random testing, is in the fact that it provides you with statistics (lies, damn lies, and statistics).\nThese statistics do give some insight where to start looking, though if really written properly, each unit test has the ability to test a\nsingle line of functional code. That’s where code coverage testing is useful, and should be part of the process too. I have no idea what\ncommercial chemoinformatics software vendors do regarding quality control, but I assume they make heavily use of code coverage too.</p>\n\n<p><a href=\"http://www.simbiosys.ca/blog/\">SimBioSys Blog</a> mentioned the use of annual software competitions. That’s important indeed, and provides\nnice means to compare options, but it is not unit testing; it’s a macroscopic test of functionality, and has little means to identifying\nunderlying fails. Is a bad CASP score caused by wrong isotope masses used in the force field, or by the approach? I’m sure no one can tell.</p>\n\n<p>Anyway, refactoring is a principle activity of software engineers, and unit testing manages that process in some way. Taking unit testing\nto the extreme, any new coding starts with writing the unit tests for the new API. Only when those are finished, the functionality is\nactually implemented.</p>\n\n<p>Ok, now something less boring. GC-MS-based <a href=\"http://en.wikipedia.org/wiki/Metabolite\">Metabolomics</a> with metabolite identity in particular.\nThough I believe there are other uses too, for example, in between sample alignment, the recovery of a full mass spectrum is particularly\nimportant for metabolite identification of new, yet unknown compounds (yes, even dereplication is already non-trivial, because of the lack\nof free (open data preferably), machine accessible (open standards!) database of mass spectra (using different ionization methods). Look\nup by monoisotopic mass is possible in, for example, <a href=\"http://www.chemspider.com/\">ChemSpider</a> (see\n<a href=\"https://chem-bla-ics.linkedchemistry.info/2007/11/26/metabolomics-workflows-in-taverna.html\">this blog <i class=\"fa-solid fa-recycle fa-xs\"></i></a>), but look up via full spectrum is less common.\nThe number of databases are growing, and likewise the openness and accessibility. Who know what the\n<a href=\"http://www.metabolomicscentre.nl/\">Netherlands Metabolomics Center</a>’s support platform will be able to offer in a year or two.</p>\n\n<p>Now, unit tests could, for example, tests that some algorithm can deconvolute the following GC-MS data:</p>\n\n<p><img src=\"/assets/images/ionChromPlot3.png\" alt=\"\" /></p>\n\n<p>The red line is the TIC for the chromatogram, while the black lines are the extracted ion chromatograms of individual m/z (ion) peaks in\nthe mass spectral dimension, and, only of peaks detected using <a href=\"http://masspec.scripps.edu/xcms/xcms.php\">XCMS</a> using the new centWave\nmethod by Ralf. Now, the results are not perfect in this diagram, but it does seem to recognize all five eluting metabolites (that’s the\namount I would guess are eluting). However, I am more interested in the methods ability to recover all m/z peaks for each metabolite, to\nallow me to identify the structure, or at least make a best possible educated guess, or, with a bit of luck the compound is already known,\nI can dereplicate it against some database (Guesses differ, but, particularly in plant metabolomics, more than half of the metabolites we\ncan now detect have a yet undetermined structure).</p>\n\n<p>Now, I’m sure any method will be able to deconvolute these compounds. They are well separated, show a nice gaussian shape, and deconvolution\nbased on just the chromatographic domain will likely already work. It starts to become more difficult for the low intensity peaks, those with\nlow signal-to-noise ratios, or those with a different elution profile (e.g. peak tailing). Deconvolution typically requires some peak shape\n(commonly Gaussian or Exponential-Modified Gaussian), while experimental data typically does not have that. Jim Downing recently introduced\nme to the term ‘Long Tail Science’ (via <a href=\"http://wwmm.ch.cam.ac.uk/blogs/murrayrust/?p=938\">this blog from Peter</a>):</p>\n\n<blockquote>\n  <p>Jim Downing cam up with the idea of “Long Tail Science”. The Long Tail is the observation that in the modern web the tail of\nthe distribution is often more important than the few large players. Large numbers of small units is an important concept. And\nit’s complimentary and complementary.</p>\n</blockquote>\n\n<p>This <em>long tail</em> of ion chromatograms is what I am interested. I do not care about the usual suspects, I want to learn about the 80%\nunknown metabolites that are found in samples. What can we learn about those? What is in the long tail of detected metabolites?</p>\n\n<p>Now, I know I am not an expert in tuning <code class=\"language-plaintext highlighter-rouge\">centWave</code> parameters, so I might as well be passing garbage in, but the method is not robust\nagainst me:</p>\n\n<div class=\"language-R highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"n\">xr</span><span class=\"w\"> </span><span class=\"o\">&lt;-</span><span class=\"w\"> </span><span class=\"n\">read</span><span class=\"p\">(</span><span class=\"n\">file</span><span class=\"o\">=</span><span class=\"s2\">\"someClosedData.cdf\"</span><span class=\"p\">)</span><span class=\"w\">\n</span><span class=\"n\">p</span><span class=\"w\"> </span><span class=\"o\">&lt;-</span><span class=\"w\"> </span><span class=\"n\">findPeaks</span><span class=\"p\">(</span><span class=\"n\">xr</span><span class=\"p\">,</span><span class=\"w\"> </span><span class=\"n\">method</span><span class=\"o\">=</span><span class=\"s2\">\"centWave\"</span><span class=\"p\">,</span><span class=\"w\"> </span><span class=\"n\">ppm</span><span class=\"o\">=</span><span class=\"m\">150</span><span class=\"p\">,</span><span class=\"w\"> </span><span class=\"n\">peakwidth</span><span class=\"o\">=</span><span class=\"nf\">c</span><span class=\"p\">(</span><span class=\"m\">5</span><span class=\"p\">,</span><span class=\"m\">25</span><span class=\"p\">))</span><span class=\"w\">\n</span></code></pre></div></div>\n\n<p>But it fails to detect some of the metabolites in the long tail:</p>\n\n<p><img src=\"/assets/images/ionChromPlot4.png\" alt=\"\" /></p>\n\n<p>As you can observe from the low S/N ratio on the red TIC line, you can notice that we are at low intensity metabolites. Assuming some\npeak shape is at such noise levels much more difficult than with better S/N ratios. The <code class=\"language-plaintext highlighter-rouge\">centWave</code> uses a really nice non-parametric approach\nhere… well, not entirely, otherwise it would not have failed over my parameter settings :) Steffen/Ralf, what was the DOI again?</p>\n\n<p>Now, I found these missed metabolites by manual browsing the data, data exploration. SBS <a href=\"http://www.simbiosys.ca/blog/2008/06/03/research-and-software-testing/\">wrote</a>\n<em>[t]here are four distinct type of tests: Func, Speed, Error and Robust</em>. I believe the above situation is really a fifth class: it’s\nneither a true <em>functional test</em>, but it is not an true <em>robustness test</em> either. The input is valid, but of such that it moves towards\ninvalid input. Scientific data is a continuous spectrum of input (remember the <a href=\"https://chem-bla-ics.linkedchemistry.info/2008/06/03/good-scientists-pimp-there-research-was.html\">oil in, oil out <i class=\"fa-solid fa-recycle fa-xs\"></i></a>).\nSoftware must be tested against such borderline data; repeatedly, over and over again, for any version, for any code change, for any\nplatform.</p>\n\n<p>Oh, and code quality has nothing to do with trust. Give me statistics (I can interpret the scope of them) over any trust assurance.</p>",
      "summary": "One aspect not covered in detail by the ongoing discussion on unit testing quality control for scientific software, is detecting regressions. This is the most important reason why unit testing is superior to random testing. Putting someone behind a keyboard to tests things is nice, but this process has to be repeated, as the testing has to be repeated over and over again. Just to make sure it works for whatever new input, for whatever refactoring, for whatever new cool feature.",
      "image": "https://chem-bla-ics.linkedchemistry.info/assets/images/ionChromPlot3.png",
      "date_published": "2008-06-04T00:00:00+00:00",
      "date_modified": "2025-08-26T00:00:00+00:00",
      "tags": ["metabolomics","rstats"],
      
      
      
      
      
      
        "authors": [ { "name": "Egon Willighagen", "url": "https://orcid.org/0000-0001-7542-0286" } ]
      
    }

  ]
}
