Learn R Programming

minval (version 0.8-2)

checkBalance: Evaluate the mass or charge balance for a set of stoichiometric reactions

Description

For a given set of stoichiometric reactions, this function evaluates the mass or charge balance using a reference data. The checkBalance function returns a boolean value 'TRUE' if the reaction is balanced. One of 'mFormula', 'mWeight' or 'mCharge' arguments must be given.

Usage

checkBalance(
  reactionList,
  referenceData,
  ids,
  mFormula = NULL,
  mWeight = NULL,
  mCharge = NULL,
  woCompartment = TRUE
)

Arguments

reactionList

A set of stoichiometric reaction with the following characteristics:

  • Arrows symbols must be given in the form '=>' or '<=>'

  • Inverse arrow symbols '<=' or other types as: '-->', '<==>', '->' will not be parsed and will lead to errors.

  • Arrow symbols and plus signs (+) must be surrounded by a space character

  • Stoichiometric coefficients must be surrounded by a space character and not by parentheses.

  • Each metabolite must have only one stoichiometric coefficient, substituents must be joined to metabolite name by a hyphen (-) symbol.

  • Exchange reactions have only one metabolite before arrow symbol

  • Compartments must be given between square brackets ([compartment]) joined at the end of metabolite name

Some examples of valid stoichiometric reactions are:

  • H2O[c] + Urea-1-Carboxylate[c] <=> 2 CO2[c] + 2 NH3[c]

  • ADP[c] + Phosphoenolpyruvate[c] => ATP[c] + Pyruvate[c]

  • CO2[c] <=>

referenceData

A chemical table containing data to evaluate the balance

ids

A mandatory ID of metabolite names column in the referenceData

mFormula

An optional ID of molecular formula column in the referenceData

mWeight

An optional ID of molecular weight column in the referenceData

mCharge

An optional ID of net charge column in the referenceData

woCompartment

A boolean value 'TRUE' or 'FALSE' to indicate if compartment label should be removed of stoichiometric reactions

Value

This function returns a boolean value 'TRUE' if reaction is balanced.

Examples

Run this code
# NOT RUN {
# Loading a set of stoichiometric reactions
glycolysis <- read.csv(system.file("extdata/glycolysisModel.csv",package = "minval"), sep='\t')

# Loading extrernal chemical information
chemicalData <- read.csv2(system.file("extdata", "chemData.csv", package = "minval"))
head(chemicalData)

# Evaluating mass balance
checkBalance(
reactionList = glycolysis$REACTION,
referenceData = chemicalData,
ids = "NAME",
mFormula = "FORMULA"
)
# }

Run the code above in your browser using DataLab