Atomic CHMC
Public functions
MarkovWeightedEFMs.CHMC.Atomic.canonicalize_smiles — Function
canonicalize_smiles(m::Vector{String})Canonicalize input SMILES string m for RXNMapper mapping.
canonicalize_smiles(m::String)Canonicalize input SMILES string m for RXNMapper mapping.
MarkovWeightedEFMs.CHMC.Atomic.find_atomic_chmc_input_errors — Function
find_atomic_chmc_input_errors(S::Matrix{<:Real}, v::Vector{<:Real})Performs a series of checks on stoichiometry matrix S and steady state flux vector v to determine whether they meet the atomic CHMC requirements. Returns an CHMCAtomicErrorSummary structure that can be printed via print(res::CHMCAtomicErrorSummary).
find_atomic_chmc_input_errors(S::Matrix{<:Real})Performs a series of checks on stoichiometry matrix S to determine whether they meet the atomic CHMC requirements for atomic EFM enumeration. Returns an CHMCAtomicErrorSummary structure that can be printed via print(res::CHMCAtomicErrorSummary).
MarkovWeightedEFMs.CHMC.Atomic.correct_atomic_chmc_input_errors — Function
correct_atomic_chmc_input_errors(#
res::CHMCAtomicErrorSummary,
S::Matrix{<:Real},
v::Vector{<:Real},
mets::Vector{String},
rxns::Vector{String}
)Corrects all errors identified by find_atomic_chmc_input_errors except for the steady state flux requirement. Returns a corrected version of each input.
S is the m by n stoichiometry matrix. v is the steady state flux vector of length n. mets is the vector of metabolite names of length m. rxns is the vector of reaction names of length n.
correct_atomic_chmc_input_errors(#
res::CHMCAtomicErrorSummary,
S::Matrix{<:Real},
mets::Vector{String},
rxns::Vector{String}
)Corrects all errors identified by find_atomic_chmc_input_errors except for the steady state flux requirement. Returns a corrected version of each input.
S is the m by n stoichiometry matrix. mets is the vector of metabolite names of length m. rxns is the vector of reaction names of length n.
Base.print — Method
print(res::CHMCAtomicErrorSummary)Write CHMCAtomicErrorSummary to stdout.
MarkovWeightedEFMs.CHMC.Atomic.correct_atomic_chmc_input_smiles — Function
correct_atomic_chmc_input_smiles(#
S::Matrix{<:Real},
v::Vector{<:Real},
mets::Vector{String},
rxns::Vector{String},
smiles::Vector{String},
H::Bool=false
)Updates the inputs by (1) removing pseudometabolites and (2) reactions whose reaction strings exceed the RXNMapper character limit. Pseudometabolites are defined as either metabolites with no defined chemical structure/SMILES representation, or metabolites whose SMILES strings contain symbols absent from the periodic table (including metabolites with an R-group). Reactions that exceed the RXNMapper character limit are converted into unimolecular sources and sinks to maintain steady state flux. Returns the corrected inputs with a list of removed metabolites/reactions.
S is the m by n stoichiometry matrix.
v is the steady state flux vector of length n.
mets is the vector of metabolite names of length m.
rxns is the vector of reaction names of length n.
smiles is the vector of metabolite smiles matching mets.
H = false will not check for hydrogen conservation in each reaction.
correct_atomic_chmc_input_smiles(#
S::Matrix{<:Real},
mets::Vector{String},
rxns::Vector{String},
smiles::Vector{String},
H::Bool=false
)Updates the inputs by (1) removing pseudometabolites and (2) reactions whose reaction strings exceed the RXNMapper character limit. Pseudometabolites are defined as either metabolites with no defined chemical structure/SMILES representation, or metabolites whose SMILES strings contain symbols absent from the periodic table (including metabolites with an R-group). Reactions that exceed the RXNMapper character limit are converted into unimolecular sources and sinks to maintain steady state flux. Returns the corrected inputs with a list of removed metabolites/reactions.
S is the m by n stoichiometry matrix.
mets is the vector of metabolite names of length m.
rxns is the vector of reaction names of length n.
smiles is the vector of metabolite smiles matching mets.
H = false will not check for hydrogen conservation in each reaction.
MarkovWeightedEFMs.CHMC.Atomic.exchange_atomic_chmc_input_metabolites — Function
exchange_atomic_chmc_input_metabolites(#
S::Matrix{<:Real},
v::Vector{<:Real},
mets::Vector{String},
rxns::Vector{String},
smiles::Vector{String},
ii::Vector{Int64}
)Removes internal metabolites ii from the remaining inputs by converting each metabolite i ∈ ii into a pair of sink and source metabolites. Returns an updated copy of inputs S, v, mets, rxns, and smiles.
S is the m by n stoichiometry matrix.
v is the steady state flux vector of length n.
mets is the vector of metabolite names of length m.
rxns is the vector of reaction names of length n.
smiles is the vector of metabolite smiles matching mets.
ii is the vector of metabolite indices to exchange for pairs of sinks/sources.
exchange_atomic_chmc_input_metabolites(#
S::Matrix{<:Real},
mets::Vector{String},
rxns::Vector{String},
smiles::Vector{String},
ii::Vector{Int64}
)Removes internal metabolites ii from the remaining inputs by converting each metabolite i ∈ ii into a pair of sink and source metabolites. Returns an updated copy of inputs S, mets, rxns, and smiles.
S is the m by n stoichiometry matrix.
mets is the vector of metabolite names of length m.
rxns is the vector of reaction names of length n.
smiles is the vector of metabolite smiles matching mets.
ii is the vector of metabolite indices to exchange for pairs of sinks/sources.
MarkovWeightedEFMs.CHMC.Atomic.get_source_metabolites — Function
get_source_metabolites(S::Matrix{Int16})Returns a vector of all source metabolites in stoichiometry matrix S.
S is the m by n stoichiometry matrix.
MarkovWeightedEFMs.CHMC.Atomic.get_max_atoms — Function
get_max_atoms(s::Vector{String}, a::Symbol)Returns the maximum number of atoms of type a for each SMILES string in s. Returns a vector of all source metabolites in stoichiometry matrix S.
s is the vector of metabolite SMILES strings.
a is a periodic table element symbol.
MarkovWeightedEFMs.CHMC.Atomic.map_reaction_strings — Function
map_reaction_strings(#
S::Matrix{<:Real},
smiles::Vector{String},
rxns::Vector{String},
H::Bool=false
)Constructs reaction strings from the smiles and then returns the atom-mapped reaction strings via RXNMapper.
S is the stoichiometry matrix.
smiles is the vector of SMILES strings for metabolites in S.
rxns is the vector of reaction names in S.
H = false will not check for hydrogen conservation in each reaction.
MarkovWeightedEFMs.CHMC.Atomic.precompute_atom_tracing_dictionary — Function
precompute_atom_tracing_dictionary(#
S::Matrix{Int16},
ms::Vector{String},
amax::Vector{Int64},
a::Symbol
)Precomputes a dictionary mapping each atom in a given substrate stoichiometric copy to its product atom across every reaction. The dictionary is used in steady_state_efm_distribution.
S is the stoichiometry matrix.
ms is the vector of mapped reaction SMILES strings.
amax is the total number of atom a in each metabolite row of S.
a is a periodic table element symbol.
MarkovWeightedEFMs.CHMC.Standard.steady_state_efm_distribution — Method
steady_state_efm_distribution(#
S::Matrix{<:Integer},
v::Vector{<:Real},
ms::Vector{String},
I::Tuple{Int64,Int64,Symbol},
D::Dict{#
NTuple{4,Int64},
Tuple{Int64,Int64}
} = Dict{NTuple{4,Int64}, Tuple{Int64,Int64}}();
solver = nothing,
verbose::Bool = true
)Enumerates the atomic EFMs from stoichiometry matrix S and compute the steady state probabilities of each EFM according to the discrete-time, cycle-history Markov chain.
S is a fully-connected, unimolecular, m by n stoichiometry matrix with m metabolites and n reactions.
v is the n-length steady state flux vector associated with S.
ms is the vector of mapped reaction SMILES strings.
I is a triplet of the metabolite row index in S, the atom index, and the atom index type. It is the initial starting state for rooting the cycle-history Markov chain.
D is the precomputed dictionary from precompute_atom_tracing_dictionary.
solver is the type used for eigenvector calculations. Default is nothing and LinearSolve will pick the best solver. Consult LinearSolve.jl for specifying other solvers.
MarkovWeightedEFMs.CHMC.Atomic.get_efm_metabolite_atom_indices — Function
get_efm_metabolite_atom_indices(res::CHMCAtomicSummary, i::Int64)Converts the sequence of metabolite indices for atomic EFM index i into metabolite names. The length of the vector of metabolite names is one element shorter than res.e[i] because the pseudometabolite connecting sink and source reactions is omitted.
res are the results from steady_state_efm_distribution.
i is the index for a given EFM.
MarkovWeightedEFMs.CHMC.Atomic.get_efm_reaction_atom_indices — Function
get_efm_reaction_indices(res::CHMCAtomicSummary, i::Int64)Converts the sequence of metabolite indices for atomic EFM index i into reaction names.
res are the results from steady_state_efm_distribution.
i is the index for a given EFM.
MarkovWeightedEFMs.CHMC.Atomic.chmc_to_mc_matrix — Function
chmc_to_mc_matrix(res::CHMCAtomicSummary, v::Vector{<:Real})Converts CHMC transition matrix res.T to a Markov chain with probabilities taken from steady state flux vector v.
res are the results from steady_state_efm_distribution.
v is the steady state flux vector used as input from steady_state_efm_distribution.
MarkovWeightedEFMs.CHMC.Atomic.export_atom_tracing_dictionary — Function
export_atom_tracing_dictionary(#
fname::String,
D::Dict{NTuple{4, Int64}, Tuple{Int64, Int64}}
)Export atom tracing dictionary D to text file fname.
fname is the filename to write the atom tracing dictionary results.
D is the dictionary from precompute_atom_tracing_dictionary.
MarkovWeightedEFMs.CHMC.Atomic.import_atom_tracing_dictionary — Function
import_atom_tracing_dictionary(fname::String)Import atomic tracing dictionary from text file fname.
fname is the filename containing the atom tracing dictionary results.
MarkovWeightedEFMs.CHMC.Atomic.preprocess_all_for_atomic_chmc — Function
preprocess_all_for_atomic_chmc(#
S::Matrix{<:Real},
v::Vector{<:Real},
mets::Vector{String},
rxns::Vector{String},
smiles::Vector{String},
atom::Symbol
)Wrapper function to run pre-processing functions and return the updated model, atomic info, and error/warning logs.
S is the m by n stoichiometry matrix. v is the steady state flux vector of length n. mets is the vector of metabolite names of length m. rxns is the vector of reaction names of length n. smiles is the vector of metabolite SMILES strings of length m. a is a periodic table element symbol.
Index
Base.printMarkovWeightedEFMs.CHMC.Atomic.canonicalize_smilesMarkovWeightedEFMs.CHMC.Atomic.chmc_to_mc_matrixMarkovWeightedEFMs.CHMC.Atomic.correct_atomic_chmc_input_errorsMarkovWeightedEFMs.CHMC.Atomic.correct_atomic_chmc_input_smilesMarkovWeightedEFMs.CHMC.Atomic.exchange_atomic_chmc_input_metabolitesMarkovWeightedEFMs.CHMC.Atomic.export_atom_tracing_dictionaryMarkovWeightedEFMs.CHMC.Atomic.find_atomic_chmc_input_errorsMarkovWeightedEFMs.CHMC.Atomic.get_efm_metabolite_atom_indicesMarkovWeightedEFMs.CHMC.Atomic.get_efm_reaction_atom_indicesMarkovWeightedEFMs.CHMC.Atomic.get_max_atomsMarkovWeightedEFMs.CHMC.Atomic.get_source_metabolitesMarkovWeightedEFMs.CHMC.Atomic.import_atom_tracing_dictionaryMarkovWeightedEFMs.CHMC.Atomic.map_reaction_stringsMarkovWeightedEFMs.CHMC.Atomic.precompute_atom_tracing_dictionaryMarkovWeightedEFMs.CHMC.Atomic.preprocess_all_for_atomic_chmcMarkovWeightedEFMs.CHMC.Standard.steady_state_efm_distribution