Reactingmoieties¶
- addBondMappingsRXNFile(rxnfileName, rxnfileDirectory)[source]¶
Add bond mappings from an MDL rxn file. :USAGE: [bondMappings] = addBondMappingsRXNFile (rxnfileName, rxnfileDirectory)
- INPUT:
rxnfileName – The file name.
- OPTIONAL INPUT:
rxnfileDirectory – Path to directory containing the rxnfile. Defaults to current directory.
- OUTPUTS:
bondMappings –
- Table of bond mapping information, with s rows, one for each bond transition.
.mets - A s x 1 cell array of metabolite identifiers for bonds.
.headAtoms - A s x 1 vector containing the numbering of the first atom forming the bond within each metabolite.
.tailAtoms - A s x 1 vector containing the
numbering of the second atom forming the bond within each metabolite. * .bTypes - A s x 1 vector of the bond type within each metabolite (1 for a single bond, 2 for a double bond, and 3 for a triple bond). * .headAtomTransitionNrs - A s x 1 vector of atom transition indice of the first atom forming the bond within each metabolite. * .tailAtomTransitionNrs - A s x 1 vector of atom transition indice of the second atom forming the bond within each metabolite. * .isSubstrate - A s x 1 logical array. True for substrates, false for
- products in the reaction for bonds.
.instances - A s x 1 vector indicating which instance of a repeated metabolite atom i belongs to for bonds.
.bondIndex - A ‘s’x 1 vector indicating a
unique numeric id for each bond * .bondTypeInstance - A s x 1 vector indicating which instance of a repeated bond with bTypes~=1 (ex: if bTypes=2—>bondTypeINstance(1)=1;bondTypeINstance(1)=2)) * .isReacting - A ‘s’x 1 vector indicating if a bond is broken (-1), formed (1) or conserved (0) * .bondTransitionNrs - A ‘s’x 1 vector indicating bond transition indices.
- buildAtomAndBondTransitionMultigraph(model, RXNFileDir, options)[source]¶
Builds a matlab digraph object representing an atom transition multigraph and a bond transition multigraph corresponding to a metabolic network from reaction stoichiometry and atom mappings. —–Atoms 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 —Bonds Note that B = incidence(dBTM) returns a b x s bond transition directed multigraph incidence matrix where b is the number of bonds and s is the number of directed bond transitions. Each bond transition inherits the orientation of its corresponding reaction.
A stoichimetric matrix may be decomposed into a set of bond transitions with the following decomposition in terms of bonds:
N=left(UW^{T}right)^{-1}UBF
UW^{T} is a diagonal matrix, where each diagonal entry is the number of bonds in each metabolite, so U*W^{T}*N = U*B*F
With respect to the input, N is the subset of model.S corresponding to bond mapped reactions
- With respect to the output U := M2Bi
W := M2BiW F := BTi2R B := incidence(dBTM);
so we have the decomposition in terms of bond M2Bi*M2BiW’*N = M2Bi*B*BTi2R
- USAGE:
[dATM, metAtomMappedBool, rxnAtomMappedBool, M2Ai, Ti2R, dBTM, M2BiE, M2BiW, BTiE] = buildAtomAndBondTransitionMultigraph (model, RXNFileDir, options)
- INPUTS:
model – Directed stoichiometric hypergraph (COBRA model structure) with 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.
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
- OPTIONAL INPUT:
options – A structure of customisable options for the function:
.sanityChecks - boolean controlling whether sanity checks are performed within the function (default = 1)
.bondTransitionMultigraph - boolean specifying whether the function generates the bond transition multigraph (default = 1)
- 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.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 s rows, one for each bond transition instance.
.EdgeTable.EndNodes - two-column cell array of character vectors that defines the graph edges
.EdgeTable.Trans - unique alphanumeric id for each bond transition instance by concatenation of the reaction, head and tail atoms
.EdgeTable.TansInstIndex - unique numeric id for each bond transition instance
.EdgeTable.dirTransInstIndex - unique numeric id for each directed bond transition instance
.EdgeTable.Rxn - reaction corresponding to each bond transition
.EdgeTable.HeadBondIndex - head Nodes.BondIndex
.EdgeTable.TailBondIndex - tail Nodes.BondIndex
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
dATME – directed atom transition multigraph (dATM) augmented with an energy node per reaction, used to build the bond transition multigraph
BG – bond graph (MATLAB graph) of the bonds, built from the nodes of dATME
dBTM – Directed bond transition multigraph as a MATLAB digraph structure with the following tables:
.Nodes — Table of node information, with q rows, one for each bonds.
.Nodes.Bond - unique alphanumeric id for each bond by
concatenation of the metabolite, head bond and tail bond * .Nodes.BondIndex - unique numeric id for each bond in bond transition multigraph * .Nodes.BondHeadAtom - the alphanumeric id for the head atom forming the bond * .Nodes.BondTailAtom - the alphanumeric id for the tail atom forming the bond * .Nodes.BondHeadAtomIndex - the numeric id for the head atom forming the bond * .Nodes.BondTailAtomIndex - the numeric id for the tail atom forming the bond * .Nodes.Met - metabolite containing each bond * .Nodes.BondType - the type of each bond (1 for a single bond, 2 for a double bond, and 3 for a triple bond) * .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.Rxn - reaction corresponding to each atom transition * .EdgeTable.HeadBondIndex - head Nodes.BondIndex * .EdgeTable.TailBondIndex - tail Nodes.BondIndex * .EdgeTable.HeadBond - head Nodes.Bond * .EdgeTable.TailBond - tail Nodes.Bond * .EdgeTable.HeadMet - head Nodes.Met * .EdgeTable.TailMet - tail Nodes.Met * .EdgeTable.HeadMetBondTypes - head Nodes.BondTypes * .EdgeTable.TailMetBondTypes - tail Nodes.BondTypes
M2BiE – m x b matrix mapping each metabolite to a bond in the directed bond transition multigraph
M2BiW – m x b matrix specifying the bond type of each metabolite-bond entry of M2BiE
BTi2R – s x n matrix mapping each directed bond transition instance to a mapped reaction
BTiE – incidence matrix of the directed bond transition multigraph (incidence(dBTM))
- buildReactingMoietyTables(reacting, formedBondsTable, brokenBondsTable)[source]¶
Build per-reaction tables of reacting moieties (formed and broken bonds) for each selected reaction
- USAGE:
reacting = buildReactingMoietyTables (reacting, formedBondsTable, brokenBondsTable)
- INPUTS:
reacting – structure describing reacting moieties, with fields:
.selectedReactionNames - cell/string array of reaction names to process
.reactMoietyTables - cell array of per-reaction moiety tables (populated by this function)
formedBondsTable – table of formed bonds, with a rxns column (.rxns) identifying the reaction of each bond
brokenBondsTable – table of broken bonds, with a rxns column (.rxns) identifying the reaction of each bond
- OUTPUTS:
reacting – input reacting structure with .reactMoietyTables populated, one table per selected reaction
- checkABRXNFiles(model, RXNFileDir)[source]¶
Checks whether the set of RXN files coresponding to a model have the consistent stoichiometry and are elementally balanced
- USAGE:
[modelOut, nTotalAtomTransitions, nTotalBondTransitions] = checkABRXNFiles (model, RXNFileDir)
- INPUTS:
model – Directed stoichiometric hypergraph (COBRA model structure) with 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.
- OPTIONAL INPUT:
RXNFileDir – Path to directory containing RXNfiles with atom mappings for internal reactions in S. File names should correspond to reaction identifiers in input rxns. Defaults to the current directory. e.g. git clone https://github.com/opencobra/ctf ~/fork-ctf
then RXNFileDir = ~/fork-ctf/rxns/atomMapped
- OUTPUTS:
modelOut – input model returned with the following boolean quality-check fields added:
.metRXNBool - m x 1 vector, true if metabolite identified in at least one RXN file
.RXNBool - n x 1 boolean vector, true if RXN file exists
.RXNParsedBool - n x 1 boolean vector, true if RXN file could be parsed
.RXNAtomsConservedBool - n x 1 boolean vector, true if atoms in RXN file are conserved
.RXNStoichiometryMatchBool - n x 1 boolean vector, true if RXN stoichiometry matches model.S stoichiometry
.RXNStoichiometryMatchUptoProtonsBool - n x 1 boolean vector, true if RXN stoichiometry matches model.S stoichiometry when ignoring protons
.RXNSubstrateTransitionNumbersOrdered - n x 1 boolean vector, true if RXN file has substrate transition numbers ordered 1:q
.RXNProductTransitionNumbersOrdered - n x 1 boolean vector, true if RXN file has product transition numbers ordered 1:q
.RXNTransitionNumbersMatching - n x 1 boolean vector, true if RXN file has matching numbering of atoms between substrates and products
.RXNMatchingElementBool - n x 1 boolean vector, true if RXN file has matching elements between substrates and products
nTotalAtomTransitions – total number of atom transitions across all RXN files
nTotalBondTransitions – total number of bond transitions across all RXN files
- createBIGraph(BG)[source]¶
Creates a multigraph (BIG) where each bond instance (e.g. in double bonds) is represented as a separate edge, preserving all node and edge properties
- USAGE:
BIG = createBIGraph (BG)
- INPUT:
BG – the original bond graph, a MATLAB graph with field:
.Nodes - node table with an Element column (the energy node has Element = ‘E’)
- OUTPUT:
BIG – bond instance graph (digraph) with duplicate edges for each bond type, preserving all properties
- createMoietyGraph(model, BG, arm)[source]¶
Generates a graph representation of moiety cycles in a metabolic network
- USAGE:
moietyGraph = createMoietyGraph (model, BG, arm)
- INPUTS:
model – COBRA model structure of the metabolic submodel, with field:
.mets - m x 1 cell array of metabolite identifiers
BG – bond graph of the metabolic network, a MATLAB graph with field:
.Nodes - node table with a mets column identifying the metabolite of each node
arm – atomically resolved model structure from identifyConservedReactingMoieties, with fields:
.L - matrix mapping isomorphism classes to metabolites
.MTG - moiety transition graph (MATLAB graph)
- OUTPUT:
moietyGraph – graph representation of moiety cycles in the metabolic network
- displayReactingMoieties(reacting)[source]¶
Print a summary and the per-reaction tables of reacting moieties to the command window
- USAGE:
displayReactingMoieties (reacting)
- INPUT:
reacting – structure describing reacting moieties, with fields:
.selectedReactionNames - cell/string array of reaction names
.reactMoietyTables - cell array of per-reaction moiety tables (one per selected reaction)
- extractBondSubgraphs(BIG, ATG)[source]¶
Extract subgraphs of bonds and their mappings from a bond instance graph
- USAGE:
[bondSubgraphs, BMG] = extractBondSubgraphs (BIG, ATG)
- INPUTS:
BIG – bond instance graph, the full weighted bond graph containing all bonds and weights
ATG – atom transition graph, representing atoms as nodes and their bonds as edges, with field:
.Nodes - node table with AtomIndex and Component columns
- OUTPUTS:
bondSubgraphs – cell array where each entry represents a subgraph of connected bonds
BMG – cell array of bond mapping graphs, representing isolated sets of mapped bonds
- findAndExtractMolecularGraphs(BIG, BMG, bondSubgraphs)[source]¶
Identify conserved and reacting isomorphic groups of bond subgraphs and extract the associated molecular graphs
- USAGE:
[CMTG, RMTG, CMG, RMG, conservedGroup, reactingGroups] = findAndExtractMolecularGraphs (BIG, BMG, bondSubgraphs)
- INPUTS:
BIG – the original bond instance graph containing all bonds and nodes, with fields:
.Edges - edge table with an EdgeIndex column
.Nodes - node table
BMG – cell array containing bond mapping graphs (subgraphs)
bondSubgraphs – cell array where each cell contains a subgraph representing a set of bonds mapped to each other
- OUTPUTS:
CMTG – conserved molecular transition graph from bondSubgraphs
RMTG – reacting molecular transition graph from bondSubgraphs
CMG – conserved molecular graph from BIG
RMG – reacting molecular graph from BIG
conservedGroup – indices of subgraphs in the largest isomorphic group
reactingGroups – indices of subgraphs not part of the largest isomorphic group
- getMetMoietySubgraphs(model, BG, arm)[source]¶
Extract metabolite, moiety, and moiety-instance subgraphs from the bond graph of a model
- USAGE:
[MG, moietyMG, moietyInstanceG] = getMetMoietySubgraphs (model, BG, arm)
- INPUTS:
model – COBRA model structure, with field:
.mets - m x 1 cell array of metabolite identifiers
BG – bipartite bond graph of the metabolic network, a MATLAB graph with field:
.Nodes - node table with a mets column identifying the metabolite of each node
arm – atomically resolved model structure from identifyConservedReactingMoieties, with fields:
.L - matrix mapping isomorphism classes to metabolites (its row count is the number of moiety classes)
.I2A - matrix mapping each isomorphism class to one or more atoms
.ATG - atom transition graph (MATLAB graph)
.MTG - moiety transition graph (MATLAB graph)
- OUTPUTS:
MG – cell array of metabolite subgraphs
moietyMG – cell array of moiety subgraphs
moietyInstanceG – cell array of moiety instance subgraphs
- identifyConservedReactingMoieties(model, BG, dATM, options)[source]¶
- This function computes:
Conserved moieties (structural moiety conservation relations) from an atom-mapped network using graph-theoretic analysis of the directed atom transition multigraph (dATM).
Reacting moieties from the bond graph (BG) by identifying reacting bonds, contracting atom-transition components, and solving a minimum set cover problem over reactions (see theory PDF, Sections on reacting moieties).
The conserved-moiety part yields a decomposition of the atom-mapped stoichiometric matrix N into moiety transitions:
N = inv(M2M*M2M’) * M2M * M * M2R
- where:
N = model.S(metAtomMappedBool, rxnAtomMappedBool) M2M = mapping metabolite -> moiety instances M = incidence(MTG) (incidence matrix of the moiety transition graph) M2R = mapping moiety transitions -> reactions
NOTE: (M2M*M2M’) is diagonal; each diagonal entry equals the number of moiety instances in the corresponding metabolite.
- USAGE:
[arm, moietyFormulae, reacting] = identifyConservedReactingMoieties (model, BG, dATM, options)
- INPUTS:
model – 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.
BG – Bond graph / molecular graph input describing intra-metabolite bonds. Must be consistent with the atom set in dATM (same atoms / indices).
dATM – Directed atom transition multigraph, obtained from buildAtomTransitionMultigraph.m A MATLAB digraph structure with the following tables and variables:
.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.mets - metabolite containing each atom
.Nodes.AtomNumber - unique numeric id for each atom in a metabolite
.Nodes.Element - atomic element of each atom
.Edges — Table of edge information, with q rows, one for each atom transition instance.
.Edges.EndNodes - two-column cell array of character vectors that defines the graph edges
.Edges.Trans - unique alphanumeric id for each atom transition instance by concatenation of the reaction, head and tail atoms
.Edges.TransIndex - unique numeric id for each atom transition instance
.Edges.rxns - reaction abbreviation corresponding to each atom transition instance
.Edges.HeadAtomIndex - head Nodes.AtomIndex
.Edges.TailAtomIndex - tail Nodes.AtomIndex
- OPTIONAL INPUTS:
options – Structure with following fields: * .sanityChecks {(0),1} true if additional sanity checks on computations, but substantially more computation time
- OUTPUTS:
arm – atomically resolved model as a matlab structure (fields detailed below)
moietyFormulae – nIsomorphismClasses x 1 cell array of conserved-moiety chemical formulae in Hill notation
reacting – structure of reacting-moiety results derived from BG and dATM
arm atomically resolved model as a matlab structure with the following fields:
arm.MRH: Directed metabolic reaction hypergraph, i.e. standard COBRA model, with additional fields: arm.MRH.metAtomMappedBool: m x 1 boolean vector indicating atom mapped metabolites arm.MRH.rxnAtomMappedBool: n x 1 boolean vector indicating atom mapped reactions
arm.dATM: Directed atom transition multigraph (dATM) obtained from buildAtomTransitionMultigraph.m
arm.M2Ai: m x a matrix mapping each mapped metabolite to one or more atoms in the directed atom transition multigraph arm.Ti2R: t x n matrix mapping one or more directed atom transition instances to each mapped reaction arm.Ti2I t x i matrix to map one or more directed atom transition instances to each isomorphism class
arm.ATG: Atom transition graph, as a MATLAB graph structure with the following tables and variables:
.Nodes — Table of node information, with a 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.mets - metabolite containing each atom
.Nodes.AtomNumber - unique numeric id for each atom in an atom mapping
.Nodes.Element - atomic element of each atom
.Nodes.MoietyIndex - numeric id of the corresponding moiety (arm.MTG.Nodes.MoietyIndex)
.Nodes.Component - numeric id of the corresponding connected component (rows of C2A)
.Nodes.IsomorphismClass - numeric id of the corresponding isomprphism class (rows of I2C)
.Nodes.IsCanonical - boolean, true if atom is within first component of an isomorphism class
.Edges — Table of edge information, with u rows, one for each atom transition instance.
.Edges.EndNodes - numeric id of head and tail atoms that defines the graph edges
.Edges.Trans - unique alphanumeric id for each atom transition by concatenation of head and tail atoms
.Edges.HeadAtomIndex - head Nodes.AtomIndex
.Edges.TailAtomIndex - tail Nodes.AtomIndex
.Edges.HeadAtom - head Nodes.Atom
.Edges.TailAtom - tail Nodes.Atom
.Edges.TransIndex - unique numeric id for each atom transition
.Edges.Component - numeric id of the corresponding connected component (columns of T2C)
.Edges.IsomorphismClass - numeric id of the corresponding isomprphism class (columns of T2I)
.Edges.IsCanonical - boolean, true if atom transition is within first component of an isomorphism class
arm.M2A: m x a matrix mapping each metabolite to one or more atoms in the (undirected) atom transition graph arm.A2R: u x n matrix that maps atom transitions to reactions. An atom transition can map to multiple reactions and a reaction can map to multiple atom transitions arm.A2Ti: u x t matrix to map each atom transition (in ATG) to one or more directed atom transition instance (in dATM) with reorientation if necessary.
arm.I2C i x c matrix to map each isomorphism class (I) to one or more components (C) of the atom transition graph (ATG) arm.C2A c x a matrix to map each connected component (C) of the atom transition graph to one or more atoms (A) arm.A2C u x c matrix to map one or more atom transitions (T) to connected components (C) of the atom transition graph (ATG)
arm.I2A i x a matrix to map each isomorphism class to one or more atoms of the atom transition graph (ATG) arm.A2I u x i matrix to map one or more atom transitions to each isomorphism class
arm.MTG = MTG; % (undirected) moiety transition graph
- identifyConservedReactingSubgraphs(model, dATM, dBTM)[source]¶
Identifies conserved and reacting bond and atom subgraphs
This function identifies conserved and reacting bond subgraphs from the bond transition multigraph and conserved and reacting atom subgraphs from the atom transition multigraph based on the provided submodel.
- USAGE:
[brokenBondsTable, formedBondsTable, CAG, RAG, CBG, RBG] = identifyConservedReactingSubgraphs (model, dATM, dBTM)
- INPUTS:
model – model structure containing the reactions of interest, with field:
.rxns - n x 1 cell array of reaction identifiers
dATM – atom transition multigraph (MATLAB digraph) with field:
.Nodes - node table with an AtomIndex column
dBTM – bond transition multigraph (MATLAB digraph) with fields:
.Edges - edge table with HeadMet and TailMet columns
.Nodes - node table with mets and BondIndex columns
- OUTPUTS:
brokenBondsTable – table of the broken bonds in the model
formedBondsTable – table of the formed bonds in the model
CAG – conserved atom subgraph
RAG – reacting atom subgraph
CBG – conserved bond subgraph
RBG – reacting bond subgraph
Check if all inputs are defined
- identifyIsomorphicClasses(CBSubgraphs, sanityChecks)[source]¶
Identifies isomorphism classes for a set of subgraphs
- USAGE:
[isomorphismClasses, firstSubgraphIndices, subsequentSubgraphIndices] = identifyIsomorphicClasses (CBSubgraphs, sanityChecks)
- INPUTS:
CBSubgraphs – cell array where each cell contains a subgraph
sanityChecks – boolean flag to enable additional consistency checks
- OUTPUTS:
isomorphismClasses – cell array where each cell contains indices of isomorphic subgraphs
firstSubgraphIndices – indices of the first subgraph in each isomorphism class
subsequentSubgraphIndices – array mapping subgraphs to their isomorphism class
Note
Requires MATLAB R2016b or later for the isisomorphic function with variable matching. Node and edge properties are compared for isomorphism detection.
- mapAontoBOld(Akey, Bkey, Ain, Bin)[source]¶
Map the values in Ain (keyed by Akey) onto the ordering of Bkey
For each element of Bkey that is a member of Akey, the corresponding value of Ain is placed at the matching position of the output. ismember returns LIBkey (true where Bkey is in Akey) and LOCAkey (the lowest index in Akey of each matched element of Bkey, 0 otherwise).
- USAGE:
Bout = mapAontoBOld (Akey, Bkey, Ain, Bin)
- INPUTS:
Akey – array of source keys
Bkey – array of target keys defining the ordering of the output
Ain – array of values corresponding to Akey (cell, double, logical or int64)
- OPTIONAL INPUT:
Bin – pre-existing output array to fill in; if omitted, an empty array of the same class as Ain and the size of Bkey is created
- OUTPUT:
Bout – array the size of Bkey, with values of Ain mapped onto the positions where Bkey is a member of Akey
- readABRXNFile(rxnfileName, rxnfileDirectory, options)[source]¶
Read atom mappings from a MDL rxn file.
- USAGE:
[atoms, bonds] = readABRXNFile (rxnfileName, rxnfileDirectory, options)
- INPUT:
rxnfileName – The file name.
- OPTIONAL INPUT:
rxnfileDirectory – Path to directory containing the rxnfile. Defaults to current directory.
options – structure of options, with field:
.readBonds - if true, also read and return the bond table (default = 1)
- OUTPUTS:
atoms –
- Table of atom information, with p rows, one for each atom.
.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.
.atomTransitionNrs - A p x 1 vector of atom transition indices.
.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.
bonds –
- Table of bond information, with q rows, one for each bond.
.mets - A q x 1 cell array of metabolite identifiers for bonds.
.headAtoms - A q x 1 vector containing the numbering of the first atom forming the bond within each metabolite.
.tailAtoms - A q x 1 vector containing the
numbering of the second atom forming the bond within each metabolite. * .bTypes - A q x 1 vector of the bond type within each metabolite (1 for a single bond, 2 for a double bond, and 3 for a triple bond). * .headAtomTransitionNrs - A q x 1 vector of atom transition indice of the first atom forming the bond within each metabolite. * .tailAtomTransitionNrs - A q x 1 vector of atom transition indice of the second atom forming the bond within each metabolite. * .isSubstrate - A q x 1 logical array. True for substrates, false for
- products in the reaction fpr bonds.
.instances - A q x 1 vector indicating which instance of a repeated metabolite atom i belongs to for bonds.
Hadjar Rahou (readBonds)