Skip to content

Commit

Permalink
A bunch of stuff related mostly to the initial CTS checkin but aslo s…
Browse files Browse the repository at this point in the history
…ome updates to MB and the main ruminiate functionality.
  • Loading branch information
john-harrold committed Dec 31, 2023
1 parent 6414ce7 commit 20a1b61
Show file tree
Hide file tree
Showing 98 changed files with 10,072 additions and 608 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Imports:
shiny,
shinyAce,
shinyWidgets,
rxode2,
stats,
stringr,
tidyr,
Expand All @@ -41,7 +42,6 @@ Suggests:
prompter,
rmarkdown,
readxl,
rxode2,
rxode2et,
shinydashboard,
testthat (>= 3.0.0),
Expand Down
15 changes: 15 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Generated by roxygen2: do not edit by hand

export(CTS_Server)
export(CTS_append_report)
export(CTS_del_current_element)
export(CTS_fetch_code)
export(CTS_fetch_current_element)
export(CTS_fetch_ds)
export(CTS_fetch_sc_meta)
export(CTS_fetch_state)
export(CTS_init_state)
export(CTS_new_element)
export(CTS_set_current_element)
export(CTS_test_mksession)
export(CTS_update_checksum)
export(MB_Server)
export(MB_append_report)
export(MB_build_code)
Expand Down Expand Up @@ -57,6 +70,8 @@ importFrom(digest,digest)
importFrom(rlang,":=")
importFrom(shinyAce,aceEditor)
importFrom(shinyAce,updateAceEditor)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(stringr,str_detect)
importFrom(stringr,str_replace)
importFrom(stringr,str_split)
Expand Down
1,907 changes: 1,907 additions & 0 deletions R/CTS_Server.R

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions R/MB_Server.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#'@param deployed Boolean variable indicating whether the app is deployed or not.
#'@param react_state Variable passed to server to allow reaction outside of module (\code{NULL})
#'@return MB Server object
# JMH Add example
MB_Server <- function(id,
id_ASM = "ASM",
FM_yaml_file = system.file(package = "formods", "templates", "formods.yaml"),
Expand Down Expand Up @@ -1523,25 +1524,25 @@ MB_test_mksession = function(session, id = "MB", full_session=TRUE){
input = list()
state = list()

# Configuration files
FM_yaml_file = system.file(package = "formods", "templates", "formods.yaml")
MOD_yaml_file = system.file(package = "ruminate", "templates", "MB.yaml")
# Creating an empty state object
state = MB_fetch_state(id = "MB",
input = input,
session = session,
FM_yaml_file = FM_yaml_file,
MOD_yaml_file = MOD_yaml_file,
react_state = NULL)
# Configuration files
FM_yaml_file = system.file(package = "formods", "templates", "formods.yaml")
MOD_yaml_file = system.file(package = "ruminate", "templates", "MB.yaml")

# Creating an empty state object
state = MB_fetch_state(id = "MB",
input = input,
session = session,
FM_yaml_file = FM_yaml_file,
MOD_yaml_file = MOD_yaml_file,
react_state = NULL)

if( Sys.getenv("ruminate_rxfamily_found") == "TRUE"){
# This will provide a list of the available models
models = MB_fetch_catalog(state)

#-------------------------------------------------------
# Simplest model:
ridx = which(models[["summary"]][["Name"]] == "PK_1cmt")
ridx = which(models[["summary"]][["Name"]] == "PK_1cmt_des")
model_row = models[["summary"]][ridx, ]

mk_rx_res = mk_rx_obj(
Expand Down
19 changes: 16 additions & 3 deletions R/ruminate.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

.onLoad <- function(libname, pkgname){


#------------------------------------
# Checking for rxpackages
# If all the suggested packages are found this will be true:
suggested_found = TRUE
#mr = FM_message("Loading ruminate", entry_type="h1")
mr = FM_message("Loading ruminate", entry_type="h1")
mr = FM_message("Checking for required nlmixr2 family of tools", entry_type="h2")

mr = FM_message("Checking for required nlmixr2 family of tools", entry_type="alert")
pkgs = c("rxode2", "nonmem2rx", "nlmixr2lib", "rxode2et")
for(pkg in pkgs){
pkg_var = paste0("ruminate_", pkg, "_found")
Expand All @@ -39,6 +38,20 @@
}

Sys.setenv(ruminate_rxfamily_found = suggested_found)

mr = FM_message("Checking for other suggested packages", entry_type="h2")

other_pkgs = c(
"clipr", "gridExtra", "prompter",
"rmarkdown", "readxl", "shinydashboard",
"ubiquity")
for(pkg in other_pkgs){
if(!requireNamespace(pkg, quietly=TRUE)){
mr = FM_message(paste0("missing ", pkg), entry_type="danger")
} else {
mr = FM_message(paste0("found ", pkg), entry_type="success")
}
}
}

#'@export
Expand Down
Loading

0 comments on commit 20a1b61

Please sign in to comment.