aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_mkinpredict_SFO_SFO.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-11 05:15:19 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-11 05:18:32 +0200
commit234c9059a95e104917e488a6ddd2313234a96cdc (patch)
treef6e54098f79d94578434ef727b62f7cc5d5e79b7 /tests/testthat/test_mkinpredict_SFO_SFO.R
parentd113cd79b178fdc91aecb894707ed356129dfb75 (diff)
Avoid merge() and data.frame() in cost function
also for deSolve and eigenvalue based solutions. This noticeably increases performance for these methods, see test.log and benchmark vignette.
Diffstat (limited to 'tests/testthat/test_mkinpredict_SFO_SFO.R')
-rw-r--r--tests/testthat/test_mkinpredict_SFO_SFO.R26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/testthat/test_mkinpredict_SFO_SFO.R b/tests/testthat/test_mkinpredict_SFO_SFO.R
index 347aa50b..d0dc7cdb 100644
--- a/tests/testthat/test_mkinpredict_SFO_SFO.R
+++ b/tests/testthat/test_mkinpredict_SFO_SFO.R
@@ -5,26 +5,28 @@ test_that("Variants of model predictions for SFO_SFO model give equivalent resul
# Do not use time 0, as eigenvalue based solution does not give 0 at time 0 for metabolites
# and relative tolerance is thus not met
tol = 0.01
- SFO_SFO.1 <- mkinmod(parent = list(type = "SFO", to = "m1"),
- m1 = list(type = "SFO"), use_of_ff = "min", quiet = TRUE)
- SFO_SFO.2 <- mkinmod(parent = list(type = "SFO", to = "m1"),
- m1 = list(type = "SFO"), use_of_ff = "max", quiet = TRUE)
+ SFO_SFO.1 <- mkinmod(parent = mkinsub("SFO", to = "m1"),
+ m1 = mkinsub("SFO"), use_of_ff = "min", quiet = TRUE)
+ SFO_SFO.2 <- mkinmod(parent = mkinsub("SFO", to = "m1"),
+ m1 = mkinsub("SFO"), use_of_ff = "max", quiet = TRUE)
ot = seq(0, 100, by = 1)
- r.1.e <- subset(mkinpredict(SFO_SFO.1,
+ r.1.e <- subset(as.data.frame(mkinpredict(SFO_SFO.1,
c(k_parent_m1 = 0.1, k_parent_sink = 0.1, k_m1_sink = 0.1),
- c(parent = 100, m1 = 0), ot, solution_type = "eigen"),
+ c(parent = 100, m1 = 0), ot, solution_type = "eigen")),
time %in% c(1, 10, 50, 100))
- r.1.d <- subset(mkinpredict(SFO_SFO.1,
+ r.1.d <- subset(as.data.frame(mkinpredict(SFO_SFO.1,
c(k_parent_m1 = 0.1, k_parent_sink = 0.1, k_m1_sink = 0.1),
- c(parent = 100, m1 = 0), ot, solution_type = "deSolve"),
+ c(parent = 100, m1 = 0), ot, solution_type = "deSolve")),
time %in% c(1, 10, 50, 100))
- r.2.e <- subset(mkinpredict(SFO_SFO.2, c(k_parent = 0.2, f_parent_to_m1 = 0.5, k_m1 = 0.1),
- c(parent = 100, m1 = 0), ot, solution_type = "eigen"),
+ r.2.e <- subset(as.data.frame(mkinpredict(SFO_SFO.2,
+ c(k_parent = 0.2, f_parent_to_m1 = 0.5, k_m1 = 0.1),
+ c(parent = 100, m1 = 0), ot, solution_type = "eigen")),
time %in% c(1, 10, 50, 100))
- r.2.d <- subset(mkinpredict(SFO_SFO.2, c(k_parent = 0.2, f_parent_to_m1 = 0.5, k_m1 = 0.1),
- c(parent = 100, m1 = 0), ot, solution_type = "deSolve"),
+ r.2.d <- subset(as.data.frame(mkinpredict(SFO_SFO.2,
+ c(k_parent = 0.2, f_parent_to_m1 = 0.5, k_m1 = 0.1),
+ c(parent = 100, m1 = 0), ot, solution_type = "deSolve")),
time %in% c(1, 10, 50, 100))
# Compare eigen and deSolve for minimum use of formation fractions

Contact - Imprint