The most abundant isotope can be detemined with the getMostFrequentNaturalIsotope function of the PeriodicSystem class. This class is not yet in the APIDoc, but available from in the struc package. Its parameter is the atomic number and returns the mass number of the most abundant isotope of the given atom. Then you can call the getMass function of the same class to have the exact mass number of that isotope. For example (nitrogen):
will return 14.003074005
It seems, however, that you want to calculate the exact mass of a molecule using the mass of the most frequent isotopes. This is often needed for MS molecule and fragment ion calculations.
Getting the result from the plugin is not very user friendly at the moment, therefore we will add some nice functions to this plugin so that exact mass could be get by a call to ElementalAnalyserPlugin.exactMass(). This will be available in the next Marvin release coming out soon.
The ElementalAnalyserPlugin class is our example plugin demonstrating how developers can create their own plugins. It embeds the ElementalAnalyser class, which actually has the exactMass function.
We decided to make this embedded class directly available in the next release, so the plugin layer will not be needed if you want to access the exact mass calculation (and some other useful functions) from code. The corresponding plugin will still be there as a free sample plugin.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum