Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
COBREXA.jl
Commits
4b521477
Unverified
Commit
4b521477
authored
May 06, 2021
by
Miroslav Kratochvil
Browse files
document hit_and_run
parent
ede116bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/analysis/sampling/hit_and_run.jl
View file @
4b521477
"""
hit_and_run(N::Int, opt_model; keepevery=100, samplesize=1000, random_objective=false)
Perform basic hit and run sampling for `N` iterations on `opt_model`, where `opt_model` is a constraint based model.
Note that `opt_model` is a JuMP model that contains whatever solver will be used to find the warmup points.
Also note, `opt_model` should already be fully constrained by however you desire.
Every `keepevery` iteration is logged as a sample, where the sample size matrix has `samplesize` columns.
Warm up points are generated in a flux variability sense, unless `random_objective` is true,
in which case a randomly weighted objective is used 2*number of reactions to define the warmup points.
Note that N needs to be >> samplesize.
Sample size is the size of the samples kept in memory.
The larger samplesize is the better the approximation becomes, but the more memory the sampler requires.
hit_and_run(
N::Int,
opt_model;
keepevery = 100,
samplesize = 1000,
random_objective = false,
)
Perform a basic hit and run sampling for `N` iterations on a constrained JuMP
model in `opt_model`.
The process generates `samplesize` samples, and logs the sample state each
`keepevery` iterations.
Warm up points are generated by minimizing and maximizing reactions as in
[`flux_variability_analysis`](@ref), unless the `random_objective` is `true`,
in which case a randomly weighted objective is used for warmup.
Note that `N` needs to be greater than sample size, and should be greater than
the dimensionality of the sampled space (i.e., at least same as the number of
reactions).
# Example
```
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment