-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
61 lines (44 loc) · 1.65 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cobrarCPLEX
<!-- badges: start -->
<!-- badges: end -->
An extension of the R-package [cobrar](https://github.com/Waschina/cobrar), which makes IBM's ILOG CPLEX solver accessible.
## Requirements
- Installed R-package [cobrar](https://github.com/Waschina/cobrar)
- Working CPLEX Installation version 20.1.0 or higher
## Installation
You can install the development version of cobrarCPLEX like so:
``` r
remotes::install_github("Waschina/cobrarCPLEX", configure.args="--with-cplex-dir=/path/to/cplex")
```
<mark>Note:</mark> Please replace `/path/to/cplex` with the path to your cplex installation.
E.g., in unix systems, cplex is by default installed to something like `/opt/ibm/ILOG/CPLEX_Studio2211/cplex`. Thus the command to install cobrarCPLEX would be:
``` r
remotes::install_github("Waschina/cobrarCPLEX", configure.args="--with-cplex-dir=/opt/ibm/ILOG/CPLEX_Studio2211/cplex")
```
## Example
This is a basic example which shows how to use cobrarCPLEX and compares the computation time for flux balance analysis:
```{r example}
library(cobrarCPLEX)
# Download the E. coli model "iML1515" from http://bigg.ucsd.edu/
modfile <- tempfile(fileext = ".xml.gz")
download.file("http://bigg.ucsd.edu/static/models/iML1515.xml.gz", modfile)
mod <- readSBMLmod(modfile)
# FBA with GLPK
COBRAR_SETTINGS("SOLVER","glpk")
print(system.time(fba(mod)))
# FBA with CPLEX
COBRAR_SETTINGS("SOLVER","cplex")
system.time(fba(mod))
```