<p>Ions in a mass spectrum are represented using two independent values for the mass-to-charge ratio [m/z] of the ion and it's relative abundance. Here's an example for caffeine from HMDB: <a href="https://hmdb.ca/spectra/ms_ms/374054" rel="nofollow noreferrer">https://hmdb.ca/spectra/ms_ms/374054</a></p>
<p>The goal of qualitative mass spectrometry is to identify compounds from their spectra using probabilistic matching algorithms, such as dot product, and libraries of reference spectra obtained from analysis of chemical reference standards. The data acquisition conditions can greatly influence the quality of the spectra obtained, and their utility in assigning identitites to features in my data. I rationalise that more informative spectra have a greater probability of yielding confident identifications so I would like to be able to maximise the information content yielded by my mass spectrometer. I would also like to be able to calculate an absolute metric of a spectrum's information content that would allow me to assess how robust my identifications are. For example, I often obtain high spectral matching scores for spectra containing very little information (a few, common peaks).</p>
<p>First I have to be able to quantify information. My (Wikipiedia) research so far has lead me to the calculation of Shannon Information.
<a href="https://en.wikipedia.org/wiki/Information_content" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Information_content</a></p>
<p>To start with I want to consider calculating the Shannon Information for a single ion in a spectrum. I can do this by calculating the probability density function [PDF] of the m/z and abundance values from a library of hundreds of thousands of reference spectra.
<a href="https://towardsdatascience.com/probability-distribution-functions-demystified-a6e882759af3" rel="nofollow noreferrer">https://towardsdatascience.com/probability-distribution-functions-demystified-a6e882759af3</a></p>
<p>Then I will be able to estimate the probability of observing an ion with that particular combination of m/z and abundance. Apparently you can sum the Shannon Information for two independent variables to get total information for that observation. But, are the two values actually independent? It is common practice in mass spec to disregard ions with abundance below a threshold of the maximum intensity observed, say 1% or 5%, as these are more likely to be noise. Is this cutoff still appropriate in this case? It seems reasonable to assume that noise ions will be more common, and so less informative, than real fragment ions in the spectrum. Their contribution to the total information content of the spectrum will be low. Is my assumption about the independence of the two values decribing an ion erroneous? Should I calculate the PDF of the m/z and the abundance, and so their Shanno Information, separately and then combine them?</p>
<p>Once I can accurately calculate Shannon Information for a particular ion I want to move to calculating the information content for a whole spectrum of ions containing hundreds of ions. Do I do this by just summing Shannon Information of each ion in the spectrum?</p>
<p>While this information would be useful in weighting the results of spectral matching algorithms so that I can filter out high match scores where either the experimental or the reference spectrum contains low information, the most useful application of this technique would be in optimising the data acquisition conditions to maximise the information obtained in my analysis.</p>

CC BY-SA 4.0
2022-11-06T00:33:04.263Z
What is your motivation for doing this? For example, when computing the information content (entropy) of English text, one clear and natural motivation is lossless compression. What insights do you hope to gain from the answers to your questions, whatever they may be?
Aryeh
CC BY-SA 4.0
2022-11-06T08:58:11.680Z
Thank you for your response. Quantifying spectral information would be useful in weighting the results of spectral matching algorithms so that I can filter out high match scores where either the experimental or the reference spectrum contains low information.
Ninja Chris
CC BY-SA 4.0
2022-11-07T08:19:35.637Z
Edited to emphaise the utility of this technique in maximising the information obtained from data acquisition.
Ninja Chris
CC BY-SA 4.0
2022-11-07T13:43:26.203Z
(From your answer in the coments), Would it not be more useful to you to have a "Similarity Distance" between "Spectral Informations", rather than an arbitrary measure (such as a variant of Shannon entropy) which you will then compare between various spectral informations? There are many known measures (e.g.  Frechet distance and Discrete Frechet distance) which might be helpful to you (and can be computed in reasonable time).
J.y B.y
CC BY-SA 4.0
2022-11-10T19:45:10.140Z
I may be mistaken but I think that information is an absolute value. As the process of generating mass spectra involves measurement error then it is useful to be able to assess the integrity of your analysis absolutely between different instruments and data acquisition settings. My Wikipedia-level understanding of the Frechet Distance is that it is a relative measure and so is not capable of providing absolute measures of data integrity.
Ninja Chris
<pr.probability><it.information-theory><information>
How do I calculate the information content of a mass spectrum?
Ninja Chris
# How do I calculate the information content of a mass spectrum?

(Asked by: username_0 on 2022-11-05)

Ions in a mass spectrum are represented using two independent values for the mass-to-charge ratio [m/z] of the ion and it's relative abundance. Here's an example for caffeine from HMDB: <https://hmdb.ca/spectra/ms_ms/374054>

The goal of qualitative mass spectrometry is to identify compounds from their spectra using probabilistic matching algorithms, such as dot product, and libraries of reference spectra obtained from analysis of chemical reference standards. The data acquisition conditions can greatly influence the quality of the spectra obtained, and their utility in assigning identitites to features in my data. I rationalise that more informative spectra have a greater probability of yielding confident identifications so I would like to be able to maximise the information content yielded by my mass spectrometer. I would also like to be able to calculate an absolute metric of a spectrum's information content that would allow me to assess how robust my identifications are. For example, I often obtain high spectral matching scores for spectra containing very little information (a few, common peaks).

First I have to be able to quantify information. My (Wikipiedia) research so far has lead me to the calculation of Shannon Information.
<https://en.wikipedia.org/wiki/Information_content>

To start with I want to consider calculating the Shannon Information for a single ion in a spectrum. I can do this by calculating the probability density function [PDF] of the m/z and abundance values from a library of hundreds of thousands of reference spectra.
<https://towardsdatascience.com/probability-distribution-functions-demystified-a6e882759af3>

Then I will be able to estimate the probability of observing an ion with that particular combination of m/z and abundance. Apparently you can sum the Shannon Information for two independent variables to get total information for that observation. But, are the two values actually independent? It is common practice in mass spec to disregard ions with abundance below a threshold of the maximum intensity observed, say 1% or 5%, as these are more likely to be noise. Is this cutoff still appropriate in this case? It seems reasonable to assume that noise ions will be more common, and so less informative, than real fragment ions in the spectrum. Their contribution to the total information content of the spectrum will be low. Is my assumption about the independence of the two values decribing an ion erroneous? Should I calculate the PDF of the m/z and the abundance, and so their Shanno Information, separately and then combine them?

Once I can accurately calculate Shannon Information for a particular ion I want to move to calculating the information content for a whole spectrum of ions containing hundreds of ions. Do I do this by just summing Shannon Information of each ion in the spectrum?

While this information would be useful in weighting the results of spectral matching algorithms so that I can filter out high match scores where either the experimental or the reference spectrum contains low information, the most useful application of this technique would be in optimising the data acquisition conditions to maximise the information obtained in my analysis.

**Tags:** pr.probability, it.information-theory, information
> **Comments:**
> **username_1**: What is your motivation for doing this? For example, when computing the information content (entropy) of English text, one clear and natural motivation is lossless compression. What insights do you hope to gain from the answers to your questions, whatever they may be?  
> **username_0**: Thank you for your response. Quantifying spectral information would be useful in weighting the results of spectral matching algorithms so that I can filter out high match scores where either the experimental or the reference spectrum contains low information.  
> **username_0**: Edited to emphaise the utility of this technique in maximising the information obtained from data acquisition.  
> **username_2**: (From your answer in the coments), Would it not be more useful to you to have a "Similarity Distance" between "Spectral Informations", rather than an arbitrary measure (such as a variant of Shannon entropy) which you will then compare between various spectral informations? There are many known measures (e.g.  Frechet distance and Discrete Frechet distance) which might be helpful to you (and can be computed in reasonable time).  
> **username_0**: I may be mistaken but I think that information is an absolute value. As the process of generating mass spectra involves measurement error then it is useful to be able to assess the integrity of your analysis absolutely between different instruments and data acquisition settings. My Wikipedia-level understanding of the Frechet Distance is that it is a relative measure and so is not capable of providing absolute measures of data integrity.  

---

## 0 answers

