Learn R Programming

sybil (version 1.1.2)

checkReactId: Check if a Reaction Id is Valid

Description

The function checkReactId evaluates a vector of reaction id's if they are unique and appear in a given model.

Usage

checkReactId(model, react, needId = FALSE)

Arguments

model
A model. An object of class modelorg, or a problem object of a lp solver.
react
Charater vector containing reaction id's, or a numerical vector containing indices of reaction id's.
needId
Logical: if reaction ids are needed (default: FALSE).

Value

  • Returns NA if the values of react do not correspond to the model, or an object of class reactId.

encoding

utf8

Details

If argument react is numeric, the maximun value will be inspected, if it is larger than the number of reactions in the model.

In case of a character vector, react is matched to the reaction id's residing in the model. If they are not found, grep is used.

If argument react is of class reactId, it will be returned without checking.

See Also

reactId

Examples

Run this code
data(Ec_core)
 
  ## Example with react as character vector
  ids <- c("ATPM", "ACK")
  idc <- checkReactId(Ec_core, ids)

  ## Example with react as numerical vector
  ids <- c(1:4)
  idc <- checkReactId(Ec_core, ids)

Run the code above in your browser using DataLab