atomTransition¶
- buildAtomTransitionMultigraph(model, RXNFileDir, options)¶
Builds a matlab digraph object representing an atom transition multigraph corresponding to a metabolic network from reaction stoichiometry and atom mappings.
The multigraph nature is due to possible duplicate atom transitions, where the same pair of atoms are involved in the same atom transition in different reactions.
The directed nature is due to possible duplicate atom transitions, where the same pair of atoms are involved in atom transitions of opposite orientation, corresponding to reactions in different directions.
Note that A = incidence(dATM) returns a a x t atom transition directed multigraph incidence matrix where a is the number of atoms and t is the number of directed atom transitions. Each atom transition inherits the orientation of its corresponding reaction.
A stoichimetric matrix may be decomposed into a set of atom transitions with the following atomic decomposition:
N=left(VV^{T}right)^{-1}VAE
VV^{T} is a diagonal matrix, where each diagonal entry is the number of atoms in each metabolite, so V*V^{T}*N = V*A*E
With respect to the input, N is the subset of model.S corresponding to atom mapped reactions
- With respect to the output V := M2Ai
E := Ti2R A := incidence(dATM);
so we have the atomic decomposition M2Ai*M2Ai’*N = M2Ai*A*Ti2R
USAGE:
[dATM, metAtomMappedBool, rxnAtomMappedBool, M2Ai, Ti2R] = buildAtomTransitionNetwork(model, RXNFileDir, options)
- INPUTS:
- model: Directed stoichiometric hypergraph
Represented by a matlab structure with following fields:
.S - The m x n stoichiometric matrix for the metabolic network
.mets - An m x 1 array of metabolite identifiers. Should match metabolite identifiers in rxnfiles.
.rxns - An n x 1 array of reaction identifiers. Should match rxnfile names in rxnFileDir.
.lb - An n x 1 vector of lower bounds on fluxes.
.ub - An n x 1 vector of upper bounds on fluxes.
- RXNFileDir: Path to directory containing rxnfiles with atom mappings
for internal reactions in S. File names should correspond to reaction identifiers in input rxns. e.g. git clone https://github.com/opencobra/ctf ~/fork-ctf
then RXNFileDir = ~/fork-ctf/rxns/atomMapped
- OUTPUT:
dATM: Directed atom transition multigraph as a MATLAB digraph structure with the following tables:
.Nodes — Table of node information, with p rows, one for each atom.
.Nodes.Atom - unique index for each atom
.Nodes.AtomIndex - unique alphanumeric id for each atom by concatenation of the metabolite, atom and element
.Nodes.Met - metabolite containing each atom
.Nodes.AtomNumber - unique numeric id for each atom in an atom mapping
.Nodes.Element - atomic element of each atom
.EdgeTable — Table of edge information, with q rows, one for each atom transition instance.
.EdgeTable.EndNodes - two-column cell array of character vectors that defines the graph edges
.EdgeTable.Trans - unique alphanumeric id for each atom transition instance by concatenation of the reaction, head and tail atoms
.EdgeTable.TansInstIndex - unique numeric id for each atom transition instance
.EdgeTable.dirTransInstIndex - unique numeric id for each directed atom transition instance
.EdgeTable.rxns - reaction corresponding to each atom transition
.EdgeTable.HeadAtomIndex - head Nodes.AtomIndex
.EdgeTable.TailAtomIndex - tail Nodes.AtomIndex
metRXNBool: m x 1 boolean vector indicating atom mapped metabolites rxnRXNBool: n x 1 boolean vector indicating atom mapped reactions M2Ai m x a matrix mapping each metabolite to an atom in the directed atom transition multigraph Ti2R t x n matrix mapping each directed atom transition instance to a mapped reaction
The internal stoichiometric matrix may be decomposition into N = (M2Ai*M2Ai)^(-1)*M2Ai*Ti*Ti2R; where Ti = incidence(dATM), is incidence matrix of directed atom transition multigraph.
- renameDREAMOutputFiles(zipfile, indir, outdir)¶
Replaces DREAM file names with original file names.
USAGE:
renameDREAMOutputFiles(zipfile, indir, outdir)
- INPUTS:
zipfile: name of zipfile submitted to the DREAM server indir: name of directory containing the DREAM output files outdir: name of directory where renamed files should be placed