isotope-0.1.0.0: Isotopic masses and relative abundances.

CopyrightMichael Thomas
LicenseGPL-3
MaintainerMichael Thomas <Michaelt293@gmail.com>
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

Isotope

Contents

Description

Import this module to work with the Isotope library. Isotope provides a range of data types, functions and class abstractions for working with elements and molecules. The main focus of Isotope is the calculation of element/molecular masses. For more information regarding Isotope, please refer to the README.

Synopsis

Type synonyms for masses

type IntegerMass = MassNumber Source #

Integer mass for an isotope.

type MonoisotopicMass = Double Source #

The exact mass of the most abundant isotope for an element or the sum of the exact masses of the most abundant isotope of each element for a molecular formula.

type NominalMass = Int Source #

The integer mass of the most abundant isotope for an element or the sum of integer mass of the most abundant isotope of each element for a chemical formula.

type AverageMass = Double Source #

The average mass of an element or molecular formula based on naturally-occurring abundances.

type IsotopicMass = Double Source #

The exact mass of an isotope.

Other type synonyms

type ElementName = String Source #

The name of an element.

type IsotopicAbundance = Double Source #

The natural abundance of an isotope.

type AtomicNumber = Int Source #

Atomic number of an element.

type ProtonNumber = AtomicNumber Source #

Proton number (i.e., the number of protons) for an element/isotope.

type NeutronNumber = Int Source #

Neutron number (i.e., the number of neutrons) for an element.

type Nucleons = (ProtonNumber, NeutronNumber) Source #

Type synonym for a pair containing ProtonNumber and NeutronNumber.

type MassNumber = Int Source #

The number of protons plus the number of neutrons (i.e., proton number + neutron number) for an isotope.

Isotope and Element data types

Element symbols

data ElementSymbol Source #

Element symbols as an enumeration type.

Constructors

H 
He 
Li 
Be 
B 
C 
N 
O 
F 
Ne 
Na 
Mg 
Al 
Si 
P 
S 
Cl 
Ar 
K 
Ca 
Sc 
Ti 
V 
Cr 
Mn 
Fe 
Co 
Ni 
Cu 
Zn 
Ga 
Ge 
As 
Se 
Br 
Kr 
Rb 
Sr 
Y 
Zr 
Nb 
Mo 
Ru 
Rh 
Pd 
Ag 
Cd 
In 
Sn 
Sb 
Te 
I 
Xe 
Cs 
Ba 
La 
Ce 
Pr 
Nd 
Sm 
Eu 
Gd 
Tb 
Dy 
Ho 
Er 
Tm 
Yb 
Lu 
Hf 
Ta 
W 
Re 
Os 
Ir 
Pt 
Au 
Hg 
Tl 
Pb 
Bi 
Th 
Pa 
U 

Instances

Bounded ElementSymbol Source # 
Enum ElementSymbol Source # 
Eq ElementSymbol Source # 
Ord ElementSymbol Source # 
Read ElementSymbol Source # 
Show ElementSymbol Source # 
ChemicalMass ElementSymbol Source # 

elementSymbolList :: [ElementSymbol] Source #

List containing all element symbols.

Functions taking an Element as input

elementMostAbundantIsotope :: Element -> Isotope Source #

Returns the most abundant naturally-occurring isotope for an element.

elementIsotopicMasses :: Element -> [IsotopicMass] Source #

Exact masses for all naturally-occurring isotopes for an element.

elementIntegerMasses :: Element -> [IntegerMass] Source #

Integer masses for all naturally-occurring isotopes for an element.

elementIsotopicAbundances :: Element -> [IsotopicAbundance] Source #

Isotope abundances for all naturally-occurring isotopes for an element.

elementMonoisotopicMass :: Element -> IsotopicMass Source #

Monoistopic mass for an element.

elementNominalMass :: Element -> MassNumber Source #

Nominal mass for an element.

elementAverageMass :: Element -> IsotopicMass Source #

Average mass of an element.

elements - a map containing isotopic data for each element.

elements :: Map ElementSymbol Element Source #

Map of the periodic table. All data on isotopic masses and abundances is contained within this map.

Functions taking an elementSymbol as input

lookupElement :: ElementSymbol -> Maybe Element Source #

Searches elements (a map) with an ElementSymbol key and returns information for the element (wrapped in Maybe).

findElement :: ElementSymbol -> Element Source #

Searches elements (a map) with an ElementSymbol key and returns information for the element.

elementName :: ElementSymbol -> ElementName Source #

Returns the name for an element symbol.

atomicNumber :: ElementSymbol -> AtomicNumber Source #

Returns the atomic number for an element.

isotopes :: ElementSymbol -> [Isotope] Source #

Returns all the naturally-occurring isotopes for an element.

mostAbundantIsotope :: ElementSymbol -> Isotope Source #

Returns the most abundant naturally-occurring isotope for an element.

selectIsotope :: ElementSymbol -> MassNumber -> Isotope Source #

Selects an isotope of element based on the isotope's mass number (IntegerMass). Note: This is a partial function.

isotopicMasses :: ElementSymbol -> [IsotopicMass] Source #

Exact masses for all naturally-occurring isotopes for an element.

integerMasses :: ElementSymbol -> [IntegerMass] Source #

Integer masses for all naturally-occurring isotopes for an element.

isotopicAbundances :: ElementSymbol -> [IsotopicAbundance] Source #

Isotope abundances for all naturally-occurring isotopes for an element.

ChemicalMass type class

class ChemicalMass a where Source #

Class containing four methods; toElementalComposition, monoisotopicMass, nominalMass and averageMass.

Minimal complete definition

toElementalComposition

Elemental composition

Molecular formulae

newtype MolecularFormula Source #

MolecularFormula is a newtype to represent a molecular formula.

Instances

Eq MolecularFormula Source # 
Ord MolecularFormula Source # 
Read MolecularFormula Source # 
Show MolecularFormula Source # 
Monoid MolecularFormula Source # 
ToEmpiricalFormula MolecularFormula Source # 
Formula MolecularFormula Source # 
ChemicalMass MolecularFormula Source # 

(|+|) :: MolecularFormula -> MolecularFormula -> MolecularFormula infixl 6 Source #

Infix operator for the addition of molecular formulae. (|+|) is mappend in the monoid instance and the same fixity as (+).

(|-|) :: MolecularFormula -> MolecularFormula -> MolecularFormula infixl 6 Source #

Infix operator for the subtraction of molecular formulae. Has the same fixity as (-).

(|*|) :: Int -> MolecularFormula -> MolecularFormula infixl 7 Source #

Infix operator for the multiplication of molecular formulae. Has the same fixity as (*).

mkMolecularFormula :: [(ElementSymbol, Int)] -> MolecularFormula Source #

Smart constructor to make values of type MolecularFormula.

Condensed formulae

newtype CondensedFormula Source #

CondensedFormula is a newtype to represent a condensed formula.

Instances

Eq CondensedFormula Source # 
Ord CondensedFormula Source # 
Read CondensedFormula Source # 
Show CondensedFormula Source # 
ToEmpiricalFormula CondensedFormula Source # 
Formula CondensedFormula Source # 
ToMolecularFormula CondensedFormula Source # 
ChemicalMass CondensedFormula Source # 

Empirical formulae

newtype EmpiricalFormula Source #

EmpiricalFormula is a newtype to represent a empirical formula.

mkEmpiricalFormula :: [(ElementSymbol, Int)] -> EmpiricalFormula Source #

Smart constructor to make values of type EmpiricalFormula.

QuasiQuoter