Old

buildAtomTransitionMultigraph_old(model, rxnfileDir, options)[source]

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

  • options

    *.directed - transition split into two oppositely

    directed edges for reversible reactions

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 alphanumeric id for each atom by concatenation of the metabolite, atom and element

  • .Nodes.AtomIndex - unique numeric id for each atom in

    atom transition multigraph

  • .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.TansIndex - unique numeric id for each atom transition instance

  • .EdgeTable.Rxn - reaction corresponding to each atom transition

  • .EdgeTable.HeadAtomIndex - head Nodes.AtomIndex

  • .EdgeTable.TailAtomIndex - tail Nodes.AtomIndex

metAtomMappedBool m x 1 boolean vector indicating atom mapped metabolites rxnAtomMappedBool 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

readAtomMappingFromRxnFile(rxnfileName, rxnfileDirectory)[source]

Read atom mappings from a rxnfile (Accelrys, San Diego, CA), written with writeRxnfile.m.

USAGE

[mets, elements, metNrs, rxnNrs, isSubstrate, instances] = readAtomMappingFromRxnFile (rxnfileName, rxnfileDirectory)

INPUT

rxnfileName – The file name.

OPTIONAL INPUT

rxnfileDirectory – Path to directory containing the rxnfile. Defaults to current directory.

OUTPUTS
  • mets – A p x 1 cell array of metabolite identifiers for atoms.

  • elements – A p x 1 cell array of element symbols for atoms.

  • metNrs – A p x 1 vector containing the numbering of atoms within each metabolite molfile.

  • rxnNrs – A p x 1 vector of atom mappings, i.e., the numbering of atoms within the reaction.

  • isSubstrate – A p x 1 logical array. True for substrates, false for products in the reaction.

  • instances – A p x 1 vector indicating which instance of a repeated metabolite atom i belongs to.