Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mspire-isotope

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mspire-isotope

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Mspire::Isotope

mspire library that can retrieve (from NIST) and yield element isotope information. Uses Neese biological ratios by default.

Installation

gem install mspire-isotope

Usage

require '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

Mspire::Isotope::BY_ELEMENT
carbon_isotopes = Mspire::Isotope::NIST::BY_ELEMENT[:C]

An array of all isotopes

all_isotopes = Mspire::Isotope::ISOTOPES

Only the monoisotopic isotopes

(the monoisotopic isotope is the one with the highest relative abundance)

monoisotopic_isotopes = Mspire::Isotope::ISOTOPES.select(&:mono)

Convenience method for access by element

# find the lightest carbon isotope
isotope = Mspire::Isotope[:C]

# find the monoisotopic (i.e., most abundant isotope) of carbon
isotope = Mspire::Isotope[:C].find(&:mono)

Information available

c12 = Mspire::Isotope[:C][0]
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][1]
...

Only use NIST data

by_element_hash = Mspire::Isotope::NIST::BY_ELEMENT
isotope_array = Mspire::Isotope::NIST::ISOTOPES

What about the convenience method? You set which element_hash you are using:

Mspire::Isotope[:C][0].relative_abundance  # => 0.9891
Mspire::Isotope.element_hash = Mspire::Isotope::NIST::BY_ELEMENT
Mspire::Isotope[:C][0].relative_abundance  # => 0.9893

FAQs

Package last updated on 31 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc