Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
f7ee5063
Unverified
Commit
f7ee5063
authored
3 years ago
by
St. Elmo
Browse files
Options
Downloads
Patches
Plain Diff
added warmup test - which fails :/
parent
78d81acd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/analysis/sampling/warmup.jl
+8
-3
8 additions, 3 deletions
src/analysis/sampling/warmup.jl
test/analysis/sampling/warmup.jl
+48
-0
48 additions, 0 deletions
test/analysis/sampling/warmup.jl
with
56 additions
and
3 deletions
src/analysis/sampling/warmup.jl
+
8
−
3
View file @
f7ee5063
...
...
@@ -16,17 +16,22 @@ function warmup(
modifications
=
[],
workerids
=
[
myid
()],
)
# create optimization problem, apply constraints
, load on all workers
# create optimization problem, apply constraints
save_model
=
:
(
begin
optmodel
=
$
COBREXA
.
make_optimization_model
(
$
model
,
$
optimizer
)
for
mod
in
$
modifications
mod
(
$
model
,
optmodel
)
end
optmodel
end
)
# load on all workers
map
(
fetch
,
save_at
.
(
workerids
,
:
cobrexa_sampling_warmup_optmodel
,
Ref
(
save_model
)))
ret
=
m
->
value
.
(
m
[
:
x
])
# get all the fluxes
# generate warm up points, like FVA
ret
=
m
->
value
.
(
m
[
:
x
])
# get all the fluxes, not just max/min like FVA
fluxes
=
dpmap
(
rid
->
:
(
$
COBREXA
.
_FVA_optimize_reaction
(
cobrexa_sampling_warmup_optmodel
,
...
...
This diff is collapsed.
Click to expand it.
test/analysis/sampling/warmup.jl
0 → 100644
+
48
−
0
View file @
f7ee5063
@testset
"Warm up point generation"
begin
model_path
=
download_data_file
(
"http://bigg.ucsd.edu/static/models/e_coli_core.json"
,
joinpath
(
"data"
,
"e_coli_core.json"
),
"7bedec10576cfe935b19218dc881f3fb14f890a1871448fc19a9b4ee15b448d8"
,
)
model
=
load_model
(
StandardModel
,
model_path
)
using
Distributed
nps
=
4
-
nprocs
()
# load extra processes, have at least 4 available
if
1
<=
nps
<=
3
addprocs
(
nps
)
end
@everywhere
using
COBREXA
,
Tulip
# Serial test
ws
,
lbs
,
ubs
=
warmup
(
model
,
Tulip
.
Optimizer
;
modifications
=
[
change_constraint
(
"EX_glc__D_e"
,
-
4
,
4
)],
warmup_points
=
collect
(
1
:
n_reactions
(
model
)),
workerids
=
[
myid
()],
)
ind
=
first
(
indexin
([
"EX_glc__D_e"
],
reactions
(
model
)))
@test
size
(
ws
)
==
(
95
,
2
)
@test
size
(
ws
[
1
,
1
])
==
(
95
,)
@test
lbs
[
ind
]
≈
-
4
@test
ubs
[
ind
]
≈
4
# Parallel test
ws
,
lbs
,
ubs
=
warmup
(
model
,
Tulip
.
Optimizer
;
modifications
=
[
change_constraint
(
"EX_glc__D_e"
,
-
4
,
4
)],
warmup_points
=
collect
(
1
:
n_reactions
(
model
)),
workerids
=
[
workers
()],
)
ind
=
first
(
indexin
([
"EX_glc__D_e"
],
reactions
(
model
)))
@test
size
(
ws
)
==
(
95
,
2
)
@test
size
(
ws
[
1
,
1
])
==
(
95
,)
@test
lbs
[
ind
]
≈
-
4
@test
ubs
[
ind
]
≈
4
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment