Molecular mass and weight

MolecularGraph.exact_massMethod
exact_mass(atomsymbol::Symbol, [digits::Int]) -> Float64
exact_mass(atom, [digits::Int]) -> Float64
exact_mass(mol::MolGraph, [digits::Int]) -> Float64

Return calculated exact mass.

source
MolecularGraph.exact_mass_uncFunction
exact_mass_unc(atomsymbol::Symbol, [number::Union{Int, Nothing}]) -> Tuple{Float64,Float64}
exact_mass_unc(atom) -> Tuple{Float64,Float64}
exact_mass_unc(mol::MolGraph) -> Tuple{Float64,Float64}

Return a tuple of calculated exact mass and its uncertainty.

If number is not given or Atom.mass is not specified, monoisotopic mass will be used instead.

source
MolecularGraph.isotopic_compositionMethod
isotopiccomposition(atomsymbol::Symbol, number::Int; threshold=0.001
    ) -> Vector{Tuple{Float64,Float64}}
isotopiccomposition(mol::MolGraph; threshold=0.001
    ) -> Vector{Tuple{Float64,Float64}}

Return isotopic composition of the atoms/molecule as a vector of tuples of mass and composition.

Records that have lower abundance than the given threshold will be filtered out (default 0.001 = 0.1%)

source
MolecularGraph.massspec_peaksMethod
massspec_peaks(mol::MolGraph; threshold=0.001) -> Matrix{Float64}

Return a vector of tuples of each isotopic masses and their relative intensity in the simulated mass spectrum (base peak intensity = 100).

Records that have lower abundance (not peak intensity) than the given threshold will be filtered out (default 0.001 = 0.1%)

source
MolecularGraph.monoiso_massMethod
monoiso_mass(atomsymbol::Symbol, [digits::Int]) -> Float64
monoiso_mass(atom, [digits::Int]) -> Float64
monoiso_mass(mol::MolGraph, [digits::Int]) -> Float64

Return monoisotopic mass of the atom/molecule.

source
MolecularGraph.monoiso_mass_uncMethod
monoiso_mass_unc(atomsymbol::Symbol) -> Tuple{Float64,Float64}
monoiso_mass_unc(atom) -> Tuple{Float64,Float64}
monoiso_mass_unc(mol::MolGraph) -> Tuple{Float64,Float64}

Return a tuple of monoisotopic mass of the atom/molecule and its uncertainty.

Monoisotopic mass is the relative atomic mass of the most abundant isotope. Even if there is specific Atom.mass value, it will be ignored.

source
MolecularGraph.nominal_massMethod
nominal_mass(atomsymbol::Symbol) -> Int
nominal_mass(atom) -> Int
nominal_mass(mol::MolGraph) -> Int

Return nominal mass of the atom/molecule.

source
MolecularGraph.simulate_massspecMethod
simulate_massspec(peaks::Vector{Tuple{Float64,Float64}};
    resolution=10000, rate=0.01) -> Matrix{Float64}
simulate_massspec(mol::MolGraph;
    threshold=0.001, resolution=10000, rate=0.01) -> Matrix{Float64}

Return a matrix of simulate mass spectrum (dim 1: datapoints, dim 2: mass and intensity).

Note that the peaks are just calculated from the isotopic composition of atoms (not intended for simulation of fragmentation).

Usage (with Plot.jl)

using MolecularGraph
using Plots
gr()
Plots.GRBackend()

mol = smilestomol("CCO")
data = simulatemassspec(mol)
plot(
    data[:, 1], data[:, 2],
    leg=false, xlabel = "Mass", ylabel = "Intensity"
)
source
MolecularGraph.standard_weightMethod
standard_weight(atomsymbol::Symbol, [digits::Int]) -> Float64
standard_weight(atom, [digits::Int]) -> Float64
standard_weight(mol::MolGraph, [digits::Int]) -> Float64

Return standard atomic weight (or molecular weight).

source
MolecularGraph.standard_weight_uncFunction
standard_weight_unc(atomsymbol::Symbol) -> Tuple{Float64,Float64}
standard_weight_unc(atom) -> Tuple{Float64,Float64}
standard_weight_unc(mol::MolGraph) -> Tuple{Float64,Float64}

Return a tuple of standard atomic weight (or molecular weight) and its uncertainty.

If Atom.mass is specified, calculated exact mass of the atom will be used instead.

source