Learn R Programming

fbar (version 0.6.0)

expanded_to_ROI: Parse a long format metabolic model to an ROI model

Description

This parses the long format produced by reactiontbl_to_expanded to an ROI model.

Usage

expanded_to_ROI(reactions_expanded)

Arguments

reactions_expanded

A list of data frames as output by reactiontbl_to_expanded

Value

A list suitable for input to ROI.

Details

To solve models using ROI, you will need a solver plugin for ROI. Probably the easiest one to install is ROI.plugin.glpk. To install this in Linux, run sudo apt-get install libglpk-dev in a terminal, and then run install.packages('ROI.plugin.glpk') in R.

The reaction_table must have columns:

  • abbreviation,

  • equation,

  • uppbnd,

  • lowbnd, and

  • obj_coef.

See Also

Other parsing_and_conversion: expanded_to_glpk(), expanded_to_gurobi(), reactiontbl_to_expanded(), reactiontbl_to_gurobi()

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
data(ecoli_core)
library(dplyr)
try(library(ROI.plugin.ecos)) # make a solver available to ROI

roi_model <- ecoli_core %>%
  reactiontbl_to_expanded %>%
  expanded_to_ROI
  
if(length(ROI::ROI_applicable_solvers(roi_model))>=1){
  roi_result <- ROI::ROI_solve(roi_model)
  
  ecoli_core_with_flux <- ecoli_core %>%
    mutate(flux = roi_result[['solution']])
}
# }

Run the code above in your browser using DataLab