Skip to content

Commit

Permalink
Deploying to gh-pages from @ 38d5f42 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
dchodge committed Oct 18, 2024
1 parent 2cef008 commit d380fe7
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 27 deletions.
7 changes: 4 additions & 3 deletions R/postprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ plot_abkinetics_trajectories <- function(model_summary, file_path) {

#' @importFrom data.table as.data.table rbindlist setDT data.table
#' @importFrom future plan multisession
plot_abkinetics_trajectories_ind <- function(model_summary, file_path) {
plot_abkinetics_trajectories_ind <- function(model_summary, file_path, parallel_i = FALSE) {

fitfull <- model_summary$fit
outputfull <- model_summary$post
Expand Down Expand Up @@ -592,8 +592,9 @@ plot_abkinetics_trajectories_ind <- function(model_summary, file_path) {
exposures_fit <- model_outline$infoModel$exposureFitted
exposures <- model_outline$exposureTypes


plan(multisession, workers = 8)
if (parallel_i) {
plan(multisession, workers = 8)
}


cat("\n Get order of all entries, \n")
Expand Down
7 changes: 4 additions & 3 deletions R/postprocess_sim.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ plotPostFigsSim <- function(model_summary, sim_model, sim_res, save_info) {

}

plot_abkinetics_trajectories_ind_sim <- function(model_summary, sim_model, sim_res, file_path) {
plot_abkinetics_trajectories_ind_sim <- function(model_summary, sim_model, sim_res, file_path, parallel_i = FALSE) {

fitfull <- model_summary$fit
outputfull <- model_summary$post
Expand Down Expand Up @@ -119,8 +119,9 @@ plot_abkinetics_trajectories_ind_sim <- function(model_summary, sim_model, sim_r
exposures_fit <- model_outline$infoModel$exposureFitted
exposures <- model_outline$exposureTypes

plan(multisession, workers = 8)

if (parallel_i) {
plan(multisession, workers = 8)
}

cat("\n Get order of all entries, \n")

Expand Down
2 changes: 1 addition & 1 deletion R/utils_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ runSeroJump <- function(seroModel, settings, priorPred = FALSE, save_info = NULL
function(i) {
rjmc_sero_func(model = i$model, data = i$data, settings = settings)
},
mc.cores = 8
mc.cores = settings$numberCores
)
} else {
out_pp_full <- lapply(list(seroModel),
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css.map

Large diffs are not rendered by default.

Binary file added inst/docs/vig_data/cesCOP/cesCOP_inputs.RDS
Binary file not shown.
Binary file added inst/docs/vig_data/cesCOP/cesCOP_sim_data_0.5.rds
Binary file not shown.
Binary file added inst/docs/vig_data/cesNoCOP/cesNoCOP_inputs.RDS
Binary file not shown.
Binary file not shown.
Binary file added inst/extdata/vig_data/cesCOP/cesCOP_inputs.RDS
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified outputs/fits/simulated_data/cop/figs/diag/invariant_param_conv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified outputs/fits/simulated_data/cop/figs/diag/transdim_conv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/cesCOP_inputs.RDS
Binary file not shown.
Binary file added vignettes/cesCOP_sim_data_0.5.rds
Binary file not shown.
Binary file added vignettes/cesNoCOP_inputs.RDS
Binary file not shown.
Binary file added vignettes/cesNoCOP_sim_data_0.5.rds
Binary file not shown.
Binary file added vignettes/cop_model_summary.RDS
Binary file not shown.
1 change: 1 addition & 0 deletions vignettes/model_define.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ save_info <- list(
rj_settings <- list(
numberChainRuns = 4,
numberCores = 2,
iterations = 2000,
burninPosterior = 1000,
thin = 1
Expand Down
Binary file added vignettes/no_cop_model_summary.RDS
Binary file not shown.
36 changes: 17 additions & 19 deletions vignettes/sim_recovery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ library(devtools)
library(tidyr)
library(dplyr)
library(magrittr)
#library(serojump)
devtools::load_all()
library(serojump)
library(patchwork)
```

## Step 2: Read Simulated Data
Expand All @@ -24,13 +24,17 @@ This data has been generated using `serosim`.
```{r}
modeli <- readRDS(file = system.file("vig_data", "cesCOP", "inputs.RDS", package = "serojump"))
res <- readRDS(file = system.file("vig_data", "cesCOP", "sim_data_0.5.RDS", package = "serojump"))
sim_model_cop <- readRDS(file = "cesCOP_inputs.RDS")
sim_res_cop <- readRDS(file = "cesCOP_sim_data_0.5.rds")
data_titre_model <- res$observed_biomarker_states %>% select(i, t, value) %>% rename(id = i, time = t, titre = value)
#modeli <- readRDS(file = system.file("extdata", "vig_data", "cesCOP", "cesCOP_inputs.RDS", package = "serojump"))
#res <- readRDS(file = system.file("extdata","vig_data", "cesCOP", "cesCOP_sim_data_0.5.RDS", package = "serojump"))
data_titre_model <- data_titre_model %>% mutate(biomarker = "sVNT") %>% as.data.frame %>% rename(sVNT = titre)
#modeli <- readRDS(file = "cesCOP_inputs.RDS")
#modeli <- readRDS(file = "cesCOP_sin_data_0.5.RDS")
data_titre_model <- sim_res_cop$observed_biomarker_states %>% select(i, t, value) %>% rename(id = i, time = t, titre = value)
data_titre_model <- data_titre_model %>% mutate(biomarker = "sVNT") %>% as.data.frame %>% rename(sVNT = titre)
```

Expand Down Expand Up @@ -139,11 +143,13 @@ p3

```{r}
sim_model_no_cop <- readRDS(file = "cesNoCOP_inputs.RDS")
sim_res_no_cop <- readRDS(file = "cesNoCOP_sim_data_0.5.rds")
modeli <- readRDS(file = system.file("vig_data", "cesNoCOP", "inputs.RDS", package = "serojump"))
res <- readRDS(file = system.file("vig_data", "cesNoCOP", "sim_data_0.5.RDS", package = "serojump"))
#modeli <- readRDS(file = system.file("extdata", "vig_data", "cesNoCOP", "cesNoCOP_inputs.RDS", package = "serojump"))
#res <- readRDS(file = system.file("extdata", "vig_data", "cesNoCOP", "cesNoCOP_sim_data_0.5.RDS", package = "serojump"))
data_titre_model <- res$observed_biomarker_states %>% select(i, t, value) %>% rename(id = i, time = t, titre = value)
data_titre_model <- sim_res_no_cop$observed_biomarker_states %>% select(i, t, value) %>% rename(id = i, time = t, titre = value)
data_titre_model <- data_titre_model %>% mutate(biomarker = "sVNT") %>% as.data.frame %>% rename(sVNT = titre)
Expand Down Expand Up @@ -268,20 +274,12 @@ save_info_no_cop <- list(
#model_summary_cop <- runInfRJMCMC(model_cop, rj_settings, save_info = save_info_cop)
#model_summary_no_cop <- runInfRJMCMC(model_no_cop, rj_settings, save_info = save_info_no_cop)
model_summary_cop <- readRDS(here::here("outputs", "fits", save_info_cop$file_name, save_info_cop$model_name, paste0("model_summary.RDS")))
model_summary_no_cop <- readRDS(here::here("outputs", "fits", save_info_no_cop$file_name, save_info_no_cop$model_name, paste0("model_summary.RDS")))
modelname_sim <- "cesCOP_notd"
sim_model_cop <- readRDS(here::here("outputs", "sim_data", modelname_sim, "inputs.RDS"))
sim_res_cop <- readRDS(file = here::here("outputs", "sim_data", modelname_sim, paste0("sim_data_", "0.5", ".rds")))
model_summary_cop <- readRDS("cop_model_summary.RDS")
model_summary_no_cop <- readRDS("no_cop_model_summary.RDS")
plotMCMCDiagnosis(model_summary_cop, save_info = save_info_cop)
plotPostFigsSim(model_summary_cop, sim_model_cop, sim_res_cop, save_info = save_info_cop)
modelname_sim <- "cesNoCOP_notd"
sim_model_no_cop <- readRDS(here::here("outputs", "sim_data", modelname_sim, "inputs.RDS"))
sim_res_no_cop <- readRDS(file = here::here("outputs", "sim_data", modelname_sim, paste0("sim_data_", "0.5", ".rds")))
plotMCMCDiagnosis(model_summary_no_cop, save_info = save_info_no_cop)
plotPostFigsSim(model_summary_no_cop, sim_model_no_cop, sim_res_no_cop, save_info = save_info_no_cop)
Expand Down

0 comments on commit d380fe7

Please sign in to comment.