Molecular mass and weight
MolecularGraph.exact_mass — Method
exact_mass(atomsymbol::Symbol, [digits::Int]) -> Float64
exact_mass(atom, [digits::Int]) -> Float64
exact_mass(mol::MolGraph, [digits::Int]) -> Float64Return calculated exact mass.
MolecularGraph.exact_mass_unc — Function
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.
MolecularGraph.isotopic_composition — Method
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%)
MolecularGraph.massspec_peaks — Method
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%)
MolecularGraph.monoiso_mass — Method
monoiso_mass(atomsymbol::Symbol, [digits::Int]) -> Float64
monoiso_mass(atom, [digits::Int]) -> Float64
monoiso_mass(mol::MolGraph, [digits::Int]) -> Float64Return monoisotopic mass of the atom/molecule.
MolecularGraph.monoiso_mass_unc — Function
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.
MolecularGraph.nominal_mass — Method
nominal_mass(atomsymbol::Symbol) -> Int
nominal_mass(atom) -> Int
nominal_mass(mol::MolGraph) -> IntReturn nominal mass of the atom/molecule.
MolecularGraph.simulate_massspec — Method
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"
)MolecularGraph.standard_weight — Method
standard_weight(atomsymbol::Symbol, [digits::Int]) -> Float64
standard_weight(atom, [digits::Int]) -> Float64
standard_weight(mol::MolGraph, [digits::Int]) -> Float64Return standard atomic weight (or molecular weight).
MolecularGraph.standard_weight_unc — Function
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.