mspire library that can retrieve (from NIST) and yield element isotope information. Uses Neese biological ratios by default.
gem install mspire-isotope
Note: by default Neese biological isotope abundance ratios are used so H, C, N, O, S have slightly different ratios than straight NIST ratios.
The Isotopes hashed by element
:::: carbon_isotopes = ::::::[:C]
An array of all isotopes
all_isotopes = ::::
Only the monoisotopic isotopes
(the monoisotopic isotope is the one with the highest relative abundance)
monoisotopic_isotopes = ::::.select(&:mono)
Convenience method for access by element
# find the lightest carbon isotope isotope = ::[:C] # find the monoisotopic (i.e., most abundant isotope) of carbon isotope = ::[:C].find(&:mono)
c12 = Mspire::Isotope[:C] c12.atomic_number # => 6 c12.element # => :C, c12.mass_number # => 12, c12.atomic_mass # => 12.0, c12.relative_abundance # => 0.9891, c12.average_mass # => 12.0107, c12.mono # => true c13 = Mspire::Isotope[:C] ...
Only use NIST data
by_element_hash = :::::: isotope_array = ::::::
What about the convenience method? You set which element_hash you are using:
::[:C].relative_abundance # => 0.9891 ::. = :::::: ::[:C].relative_abundance # => 0.9893