The Gnome Chemistry Utils
0.14.0
|
#include <gcu/isotope.h>
Public Member Functions | |
IsotopicPattern () | |
IsotopicPattern (int min, int max) | |
IsotopicPattern * | Simplify (void) |
IsotopicPattern * | Multiply (IsotopicPattern &pattern) |
IsotopicPattern * | Square (void) |
void | Copy (IsotopicPattern &pattern) |
void | SetValue (int A, double percent) |
void | Normalize () |
void | Clear () |
void | Ref () |
void | Unref () |
int | GetMinMass () |
int | GetMonoNuclNb () |
SimpleValue const & | GetMonoMass () |
void | SetMonoMass (SimpleValue mass) |
int | GetValues (double **values) |
Objects of this class represent the isotopic pattern corresponding to a chemical formula.
The formalism used is similar to polynoms algebra, since calculate the isotopic pattern of the reunion of two fragments is equivalent to a polynomial multiplication.
gcu::IsotopicPattern::IsotopicPattern | ( | ) |
Default constructor. Initialize members to nul values. The IsotopicPattern is given an initial reference count of 1.
gcu::IsotopicPattern::IsotopicPattern | ( | int | min, |
int | max | ||
) |
Sets the minimum and maximum mass numbers of the pattern, and reserves memory to store the abundances of the mass fragments. The IsotopicPattern is given an initial reference count of 1.
void gcu::IsotopicPattern::Clear | ( | ) |
Clears the contents of an isotopic pattern for reuse.
void gcu::IsotopicPattern::Copy | ( | IsotopicPattern & | pattern | ) |
pattern,: | the isotopic pattern to be copied. Set the values of the isotopic pattern so that it becomes identical to pattern. |
|
inline |
|
inline |
|
inline |
int gcu::IsotopicPattern::GetValues | ( | double ** | values | ) |
values,: | where to store the pointer to the abundances of the various mass fragments as a percentage of the most abundant one. The pointer should be freed with g_free when not anymore nedded. |
IsotopicPattern* gcu::IsotopicPattern::Multiply | ( | IsotopicPattern & | pattern | ) |
Effects a polynomial multiplication to calculate the pattern correponding to the reunion of the two fragments.
void gcu::IsotopicPattern::Normalize | ( | ) |
Effects the same multiplication on all abundances so that the largest becomes 100.
|
inline |
void gcu::IsotopicPattern::SetMonoMass | ( | SimpleValue | mass | ) |
mass,: | the mass of the most abundant isotope. |
This method is used when building an Isotopic Pattern from raw data. To enter the data for each isotope, use IsotopicPattern::SetValue. It has no effect if the current monoisotopic mass is not nul.
void gcu::IsotopicPattern::SetValue | ( | int | A, |
double | percent | ||
) |
A,: | the mass number of the isotope. |
percent,: | the abundance of the isotope. |
This method is used when building an Isotopic Pattern from raw data. IsotopicPattern::SetMonoMass should be called when data for each isotope have been entered.
IsotopicPattern* gcu::IsotopicPattern::Simplify | ( | void | ) |
This method creates a copy of the original object with abundances normalized as a percentage of the largest value, and removes very small values to save time in subsequent calculations.
IsotopicPattern* gcu::IsotopicPattern::Square | ( | void | ) |
Squares the original pattern to get the pattern corresponding to twice the original formula.
void gcu::IsotopicPattern::Unref | ( | ) |
Decrements the reference count of the pattern. If the reference count becomes 0, the object is destroyed.