diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2023-04-20 20:17:12 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2023-04-20 20:17:12 +0200 |
commit | 7b7c4bf493ba15824ea43bed764661678b4aca03 (patch) | |
tree | 48de1e32327c36ee49fc476dc76ece8397ab55c6 /vignettes/prebuilt | |
parent | 842998b688037c007d8876d7e1110c929fe2374c (diff) | |
parent | 9ae42bd20bc2543a94cf1581ba9820c2f9e3afbd (diff) |
Merge branch 'v1.2.3_pkgdown'
Diffstat (limited to 'vignettes/prebuilt')
-rw-r--r-- | vignettes/prebuilt/2022_cyan_pathway.pdf | bin | 662810 -> 680647 bytes | |||
-rw-r--r-- | vignettes/prebuilt/2022_cyan_pathway.rmd | 45 | ||||
-rw-r--r-- | vignettes/prebuilt/2022_dmta_pathway.pdf | bin | 607514 -> 607671 bytes | |||
-rw-r--r-- | vignettes/prebuilt/2022_dmta_pathway.rmd | 24 |
4 files changed, 51 insertions, 18 deletions
diff --git a/vignettes/prebuilt/2022_cyan_pathway.pdf b/vignettes/prebuilt/2022_cyan_pathway.pdf Binary files differindex 9d2d22ea..ec37706f 100644 --- a/vignettes/prebuilt/2022_cyan_pathway.pdf +++ b/vignettes/prebuilt/2022_cyan_pathway.pdf diff --git a/vignettes/prebuilt/2022_cyan_pathway.rmd b/vignettes/prebuilt/2022_cyan_pathway.rmd index df34a6f2..8463c854 100644 --- a/vignettes/prebuilt/2022_cyan_pathway.rmd +++ b/vignettes/prebuilt/2022_cyan_pathway.rmd @@ -1,7 +1,7 @@ --- title: "Testing hierarchical pathway kinetics with residue data on cyantraniliprole" author: Johannes Ranke -date: Last change on 6 January 2023, last compiled on `r format(Sys.time(), "%e +date: Last change on 20 April 2023, last compiled on `r format(Sys.time(), "%e %B %Y")` output: pdf_document: @@ -50,11 +50,19 @@ library(knitr) library(saemix) library(parallel) n_cores <- detectCores() -if (Sys.info()["sysname"] == "Windows") { - cl <- makePSOCKcluster(n_cores) -} else { - cl <- makeForkCluster(n_cores) + +# We need to start a new cluster after defining a compiled model that is +# saved as a DLL to the user directory, therefore we define a function +# This is used again after defining the pathway model +start_cluster <- function(n_cores) { + if (Sys.info()["sysname"] == "Windows") { + ret <- makePSOCKcluster(n_cores) + } else { + ret <- makeForkCluster(n_cores) + } + return(ret) } +cl <- start_cluster(n_cores) ``` \clearpage @@ -135,6 +143,10 @@ illparms(cyan_saem_reduced) anova(cyan_saem_reduced) |> kable(digits = 1) ``` +```{r} +stopCluster(cl) +``` + # Pathway fits ## Evaluations with pathway established previously @@ -178,6 +190,7 @@ cyan_path_1 <- list( JSE76 = mkinsub("SFO"), quiet = TRUE, name = "hs_path_1", dll_dir = "cyan_dlls", overwrite = TRUE) ) +cl_path_1 <- start_cluster(n_cores) ``` To obtain suitable starting values for the NLHM fits, separate pathway fits are performed for all datasets. @@ -187,7 +200,7 @@ f_sep_1_const <- mmkin( cyan_path_1, cyan_ds, error_model = "const", - cluster = cl, + cluster = cl_path_1, quiet = TRUE) status(f_sep_1_const) |> kable() @@ -209,7 +222,7 @@ currently under development. ```{r, f-saem-1, dependson = "f-sep-1"} f_saem_1 <- mhmkin(list(f_sep_1_const, f_sep_1_tc), no_random_effect = illparms(cyan_saem_full), - cluster = cl) + cluster = cl_path_1) ``` ```{r dependson = "f-saem-1"} @@ -253,6 +266,9 @@ at later time points are strongly and systematically underestimated. \clearpage +```{r} +stopCluster(cl_path_1) +``` ## Alternative pathway fits @@ -294,11 +310,13 @@ cyan_path_2 <- list( overwrite = TRUE ) ) + +cl_path_2 <- start_cluster(n_cores) f_sep_2_const <- mmkin( cyan_path_2, cyan_ds, error_model = "const", - cluster = cl, + cluster = cl_path_2, quiet = TRUE) status(f_sep_2_const) |> kable() @@ -319,7 +337,7 @@ Sassafras dataset. ```{r f-saem-2, dependson = c("f-sep-2-const", "f-sep-2-tc")} f_saem_2 <- mhmkin(list(f_sep_2_const, f_sep_2_tc), no_random_effect = illparms(cyan_saem_full[2:4, ]), - cluster = cl) + cluster = cl_path_2) ``` ```{r dependson = "f-saem-2"} @@ -384,11 +402,11 @@ no_ranef[["sforb_path_2", "const"]] <- c("cyan_free_0", "f_JCZ38_qlogis", "f_JSE76_qlogis") no_ranef[["sforb_path_2", "tc"]] <- c("cyan_free_0", "log_k_cyan_free_bound", "f_JCZ38_qlogis", "f_JSE76_qlogis") -clusterExport(cl, "no_ranef") +clusterExport(cl_path_2, "no_ranef") f_saem_3 <- update(f_saem_2, no_random_effect = no_ranef, - cluster = cl) + cluster = cl_path_2) ``` ```{r dependson = "f-saem-3"} @@ -413,6 +431,10 @@ two-component error) are lower than in the previous fits with the alternative pathway, the practical value of these refined evaluations is limited as no confidence intervals are obtained. +```{r} +stopCluster(cl_path_2) +``` + \clearpage # Conclusion @@ -520,7 +542,6 @@ for (deg_mod in rownames(f_saem_3)) { ## Session info ```{r, echo = FALSE, cache = FALSE} -parallel::stopCluster(cl = cl) sessionInfo() ``` diff --git a/vignettes/prebuilt/2022_dmta_pathway.pdf b/vignettes/prebuilt/2022_dmta_pathway.pdf Binary files differindex 56534ebf..95d0964d 100644 --- a/vignettes/prebuilt/2022_dmta_pathway.pdf +++ b/vignettes/prebuilt/2022_dmta_pathway.pdf diff --git a/vignettes/prebuilt/2022_dmta_pathway.rmd b/vignettes/prebuilt/2022_dmta_pathway.rmd index ff2b527c..1e1a0719 100644 --- a/vignettes/prebuilt/2022_dmta_pathway.rmd +++ b/vignettes/prebuilt/2022_dmta_pathway.rmd @@ -1,7 +1,7 @@ --- title: "Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P" author: Johannes Ranke -date: Last change on 8 January 2023, last compiled on `r format(Sys.time(), "%e %B %Y")` +date: Last change on 20 April 2023, last compiled on `r format(Sys.time(), "%e %B %Y")` geometry: margin=2cm bibliography: references.bib toc: true @@ -45,10 +45,17 @@ library(knitr) library(saemix) library(parallel) n_cores <- detectCores() -if (Sys.info()["sysname"] == "Windows") { - cl <- makePSOCKcluster(n_cores) -} else { - cl <- makeForkCluster(n_cores) + +# We need to start a new cluster after defining a compiled model that is +# saved as a DLL to the user directory, therefore we define a function +# This is used again after defining the pathway model +start_cluster <- function(n_cores) { + if (Sys.info()["sysname"] == "Windows") { + ret <- makePSOCKcluster(n_cores) + } else { + ret <- makeForkCluster(n_cores) + } + return(ret) } ``` @@ -163,6 +170,8 @@ m_hs_path_1 <- mkinmod( unload = TRUE, overwrite = TRUE, quiet = TRUE ) +cl <- start_cluster(n_cores) + deg_mods_1 <- list( sfo_path_1 = m_sfo_path_1, fomc_path_1 = m_fomc_path_1, @@ -332,6 +341,10 @@ plot(saem_sforb_path_1_tc_reduced) Plots of the remaining fits and listings for all successful fits are shown in the Appendix. +```{r} +stopCluster(cl) +``` + # Conclusions @@ -410,7 +423,6 @@ tex_listing(saem_sforb_path_1_tc_reduced, caption) ## Session info ```{r, echo = FALSE} -parallel::stopCluster(cl) sessionInfo() ``` |