# shared configs
shared_config <- function() list(data = cdata,
factorx = "type$|grp$|cat$|score$|grade$|bin$|pos$|^male$|^sex$|^race$|risk$",
colors = c("Autoab Pos" = "orange",
"Cystic fibrosis" = "aquamarine4",
"Gastric Bypass" = "bisque4",
"Gestational diabetes" = "deeppink2",
"Monogenic Diabetes" = "red4",
"No diabetes" = "royalblue2",
"Other-Diabetes" = "indianred4",
"Other-No Diabetes" = "steelblue2",
"T1D" = "red",
"T1D Medalist" = "maroon",
"T2D" = "purple",
"Pending" = "gray",
"Pregnancy" = "pink",
"Transplant" = "darkseagreen4"))
#' Run app locally
#' @export
nPOD_DataView <- function() suppressWarnings(runApp(appDir = system.file("app", package = "nPOD")))
#' matrixMix config
#' @export
matrixMix_config <- function() list(M = cordata$M,
N = cordata$N,
cdata = shared_config()$data,
metadata = matrix_metadata,
vkey = "VarID",
# widgetopt = "CellTissue",
# widgetdata = system.file("www/", "test.json", package = "DIVE"),
factorx = shared_config()$factorx,
dcolors = list(donor.type = shared_config()$colors))
#' Launch DIVE matrix module with nPOD data
#'
#' @export
matrixMixR <- function() do.call(DIVE::matrixMixR, c(ns = "nPOD", matrixMix_config()))
##-----------------------------------------------------------------------------------------------------------------------------------------------------#
#' multiVUI app config
multiV_config <- function() list(hdata = hdata,
hcat = list(Transcriptomics = list("Kodama et al. (2016)", "Holm et al. (2018)"),
Proteomics = list("Liu et al. (2016)", "Nyalwidhe et al. (2017)")),
cdata = shared_config()$data,
factorx = shared_config()$factorx,
preselect = "donor.type")
#' Launch DIVE multi-view module with nPOD data
#'
#' @export
multiVUIR <- function() do.call(DIVE::multiVUIR, c(ns = "nPOD", multiV_config()))
##-----------------------------------------------------------------------------------------------------------------------------------------------------#
#' browseR config
#' @export
browse_config <- function() list(dt_id = cdata,
index1 = "ID",
index2 = "donor.type",
dt_var = metadata_map,
dt_var_index = "VarID",
dt_var_ext = metadata_ext)
#' Launch DIVE browser module with nPOD data
#'
#' @export
browseR <- function() do.call(DIVE::browseR, c(ns = "nPOD", browse_config()))
##-----------------------------------------------------------------------------------------------------------------------------------------------------#
#' matchApp config
#' @export
matchApp_config <- function() list(subsets = list("No diabetes" = list("No diabetes", "Other-No Diabetes"),
"Autoantibody positive" = list("Autoab Pos"),
"Type 1 Diabetes" = list("T1D", "T1D Medalist", "Monogenic Diabetes"),
"Other diabetes" = list("T2D", "Gestational diabetes"),
"Other" = list("Transplant", "Cystic fibrosis", "Pregnancy", "Gastric Bypass")),
refdata = npodX,
datakey = "Cohort",
xname = "CohortX",
refname = "nPOD",
HPCG = hpcg,
colors = shared_config()$colors,
vars = list(Clinical = c("BMI", "db.duration", "age.onset",
"Cpeptide", "HbA1c", "peak.gluc",
"GADA.pos", "IA2A.pos", "mIAA.pos", "ZnT8A.pos", "AutoAb.count"),
Demographic = c("age", "sex_Female", "sex_Male",
"race_Caucasian", "race_AfricanAmerican", "race_Hispanic.Latino",
"race_Asian", "race_AmericanIndian", "race_Multiracial")),
subsetfeat = "donor.type",
factorx = shared_config()$factorx,
appdata = "appdata/divid_coded.csv")
#' Launch DIVE match module with nPOD data
#'
#' @export
matchAppR <- function() do.call(DIVE::matchAppR, c(ns = "nPOD", matchApp_config()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.