Elements
The Elements class provides information about the element's atomic number, symbol, periodic table group and period, covalent radius and Van der Waals radius, and Pauling electronegativity (Groovy code):
Elements lithium = Elements.Lithium
println "atomic number: " + lithium.number()
println "symbol: " + lithium.symbol()
println "periodic group: " + lithium.group()
println "periodic period: " + lithium.period()
println "covalent radius: " + lithium.covalentRadius()
println "Vanderwaals radius: " + lithium.vdwRadius()
println "electronegativity: " + lithium.electronegativity()
atomic number: 3
symbol: Li
periodic group: 1
periodic period: 2
covalent radius: 1.34
Vanderwaals radius: 2.2
electronegativity: 0.98
Isotopes
Similarly, there is the Isotopes class to help you look up isotope information. For example, you can get all isotopes for an element or just the major isotope:isofac = Isotopes.getInstance();
isotopes = isofac.getIsotopes("H");
majorIsotope = isofac.getMajorIsotope("H")
for (isotope in isotopes) {
print "${isotope.massNumber}${isotope.symbol}: " +
"${isotope.exactMass} ${isotope.naturalAbundance}%"
if (majorIsotope.massNumber == isotope.massNumber)
print " (major isotope)"
println ""
}
For hydrogen this gives:
1H: 1.007825032 99.9885% (major isotope)
2H: 2.014101778 0.0115%
3H: 3.016049278 0.0%
4H: 4.02781 0.0%
5H: 5.03531 0.0%
6H: 6.04494 0.0%
7H: 7.05275 0.0%
This class is also used by the getMajorIsotopeMass() method in the MolecularFormulaManipulator class to calculate the monoisotopic mass of a molecule:
molFormula = MolecularFormulaManipulator
.getMolecularFormula(
"C2H6O",
SilentChemObjectBuilder.getInstance()
)
println "Monoisotopic mass: " +
MolecularFormulaManipulator.getMajorIsotopeMass(
molFormula
)
The output for ethanol looks like:
Monoisotopic mass: 46.041864812

No comments:
Post a Comment