Gives information about possible isotopes of a molecule: isotopic content, mass, abundance, relative intensity of a signal in a Mass Spectrometer. You can get all isotopologues of a molecule sorted from the most common to the rarest.
//create an iterator of all isotopologues of C6H12O6 with minimal intensity 1E-10 (but second parameter can be ignored to have no limit)
Iterator<Isotopologue> it = IsotopologueIteratorFactory.createIsotopologueIterator("C6H12O6", 1E-10);
// iterate over all isotopologues in descending order (by intensity) that have intensity > minimal intensity
while (it.hasNext()) {
Isotopologue is = it.next();
System.out.println(is.mass + ": " + is.abundance + "\t" + is);
}
Use Maven to get the library (latest version: ):
<dependency>
<groupId>io.elsci.isotope-distribution</groupId>
<artifactId>isotope-distribution</artifactId>
<version>LATEST VERSION</version>
</dependency>
After a spectrum is captured, we need to determine which of the masses within that spectrum belong to our compound. A compound consists of atoms, each of them can have isotopes with different masses.
For instance
Isotopologue | Molecular Mass | Probability | Mass Spec Intensity |
---|---|---|---|
1 | |||
0.002005373 | |||
0.0003008059 | |||
... | ... | ... | ... |
We don't really want to go over all the combinations as most of them are too rare. In the example above only the primary isotopologue is interesting, the rest can be ignored in most situations. But in larger molecules we may be interested in a couple of dozens of isotopologues. Thus we need a way to list the ones that we'll be interested in. The naive approach will result in a quadratic algorithm which is too slow for large molecules.
This library is a wrapper around Multinomial selection where most of the combinatorics is concentrated. That library is more generic and can be used outside of chemistry/isotopes context.
Outside of chemistry getting this problem mostly boils down to selecting most probable events out of a multinomial. In math terms getting all possible isotopes and their masses can be represented with this formula:
where
-
$a1$ ,$a2$ are probabilities of the 1st and 2nd isotope of first element (basically$p(^1H)$ ,$p(^2H)$ in our example at the top) and$b_1$ ,$b_2$ are isotopes of the 2nd element (it's$p(^{16}O)$ and$p(^{18}O)$ probabilities). -
$\alpha_1$ ,$\alpha_2$ are molecular masses of those isotopes -
$A$ and$B$ is the number of repeats of these elements (2 and 1 in our example).
Try it for