Rxn¶
- checkRXNFiles(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] = checkRXNFiles (model, RXNFileDir)
- INPUTS:
model – Directed stoichiometric hypergraph Represented by a matlab structure with following fields:
.S - The m x n stoichiometric matrix for the metabolic network
.model.mets - An m x 1 array of metabolite identifiers. Should match metabolite identifiers in RXNfiles.
.model.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 model.rxns. e.g. git clone https://github.com/opencobra/ctf ~/fork-ctf
then RXNFileDir = ~/fork-ctf/rxns/atomMapped
- OUTPUTS:
modelOut – The input model returned with the RXN-file quality-check results added as fields:
.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 with substrate transition numbers ordered 1:q
.RXNProductTransitionNumbersOrdered - n x 1 boolean vector, true if RXN file with product transition numbers ordered 1:q
.RXNTransitionNumbersMatching - n x 1 boolean vector, true if RXN file with matching numbering of atoms between substrates and products
.RXNMatchingElementBool - n x 1 boolean vector, true if RXN file with matching elements between substrates and products
nTotalAtomTransitions – total number of atom transitions across all atom mapped RXN files
- findRXNFiles(model, rxnfileDir)[source]¶
Identify the model metabolites and reactions that have a corresponding atom mapped RXN file
- USAGE:
[metRXNBool, rxnRXNBool, internalRxnBool] = findRXNFiles (model, rxnfileDir)
- INPUTS:
model – COBRA model structure with the fields:
.rxns - n x 1 array of reaction identifiers
.S - m x n stoichiometric matrix
.SConsistentRxnBool - n x 1 boolean vector, true for stoichiometrically consistent reactions (used if present)
.SIntRxnBool - n x 1 boolean vector, true for internal reactions (used when .SConsistentRxnBool is absent)
rxnfileDir – path to directory containing atom mapped reactions. One .RXN file per reaction with each filename matching to model.rxns{i}
- OUTPUTS:
metRXNBool – m x 1 boolean vector true for metabolites in atom mapped reactions
rxnRXNBool – n x 1 boolean vector true for atom mapped reactions
internalRxnBool – n x 1 boolean vector true for reactions considered internal
- readRXNFile(rxnfileName, rxnfileDirectory)[source]¶
Read atom mappings from a MDL rxn file.
- USAGE:
[mets, elements, metNrs, atomTransitionNrs, isSubstrate, instances] = readRXNFile (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.
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.
- writeRxnfile(s, mets, molfileNames, molfileDirectory, rxnfileName, rxnfileDirectory)[source]¶
Writes a rxnfile (Accelrys, San Diego, CA) for a metabolic reaction.
- USAGE:
writeRxnfile (s, mets, molfileNames, molfileDirectory, rxnfileName, rxnfileDirectory)
- INPUTS:
s – An m x 1 vector of stoichiometric coefficients.
mets – An m x 1 cell array of metabolite identifiers.
- OPTIONAL INPUTS:
molfileNames – An m x 1 cell array of molfile names for metabolites in mets. Defaults to mets.
molfileDirectory – Path to directory containing input molfiles. Defaults to current directory.
rxnfileName – A name for the output rxnfile. Defaults to ‘rxn.rxn’.
rxnfileDirectory – Path to directory where the output rxnfile should be saved. Defaults to current directory.
Produces the file ‘rxnfileDirectory/rxnfileName.rxn’