Package 'CaPO4Sim'

Title: A Virtual Patient Simulator in the Context of Calcium and Phosphate Homeostasis
Description: Explore calcium (Ca) and phosphate (Pi) homeostasis with two novel 'Shiny' apps, building upon on a previously published mathematical model written in C, to ensure efficient computations. The underlying model is accessible here <https://pubmed.ncbi.nlm.nih.gov/28747359/)>. The first application explores the fundamentals of Ca-Pi homeostasis, while the second provides interactive case studies for in-depth exploration of the topic, thereby seeking to foster student engagement and an integrative understanding of Ca-Pi regulation.
Authors: David Granjon [aut, cre, cph], Diane de Zélicourt [cph], Vartan Kurtcuoglu [cph], Olivier Bonny [cph], François Verrey [cph], University of Lausanne [fnd], University of Zurich [fnd], Kidney NCCR.CH [fnd], The Interface Group [cph] (Hosting Group), RinteRface [cph] (R/HTML Templates)
Maintainer: David Granjon <[email protected]>
License: GPL-3
Version: 0.2.1
Built: 2024-11-16 05:21:35 UTC
Source: https://github.com/divadnojnarg/capo4sim

Help Index


Highlight arrows for steady state events

Description

Use inside in the networkCaPO4. Nothing is returned except that the network is updated via visNetworkProxy.

Usage

arrow_lighting(edges, simulation, counter, session)

Arguments

edges

A dataframe of edges provided by generate_edges.

simulation

Which disease is currently selected. See extract_running_sim.

counter

To determine which notification to display. We expect a counter returned by the networkCaPO4 module.

session

Session object.


CaPO4Sim

Description

Explore calcium (Ca) and phosphate (Pi) homeostasis with two novel 'Shiny' apps, building upon on a previously published mathematical model written in C, to ensure efficient computations. The underlying model is accessible here <https://www.ncbi.nlm.nih.gov/pubmed/28747359>. The first application explores the fundamentals of Ca-Pi homeostasis, while the second provides interactive case studies for in-depth exploration of the topic, thereby seeking to foster student engagement and an integrative understanding of Ca-Pi regulation. These applications are hosted at <https://rinterface.com/AppsPhysiol.html>.

Author(s)

Maintainer: David Granjon [email protected] [copyright holder]

Other contributors:

  • Diane de Zélicourt [copyright holder]

  • Vartan Kurtcuoglu [copyright holder]

  • Olivier Bonny [copyright holder]

  • François Verrey [copyright holder]

  • University of Lausanne [funder]

  • University of Zurich [funder]

  • Kidney NCCR.CH [funder]

  • The Interface Group (Hosting Group) [copyright holder]

  • RinteRface (R/HTML Templates) [copyright holder]


Create a checkbox for diseaseSelectUi

Description

Create a prettyCheckbox.

Usage

diseaseCheckBox(inputId, label)

Arguments

inputId

Checkbox Input id.

label

Checkbox label.


Create a disease selector server logic

Description

Only returns inputs associated with php1, hypopara, hypoD3

Usage

diseaseSelect(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


Create a disease selector UI module

Description

Contains php1, hypopara, hypoD3

Usage

diseaseSelectUi(id)

Arguments

id

module id.


Extract the current running simulation

Description

Simulations are currently php1, hypoD3 and hypopara. Takes diseases as input given by the diseaseSelect module.

Usage

extract_running_sim(diseases)

Arguments

diseases

Shiny input disease selector. See diseaseSelect.


Create a fullScreen server logic

Description

Nothing is contained inside for now...

Usage

fullScreen(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


Create a fullScreen UI module

Description

Trigger a fullScreen mode. Based on https://stackoverflow.com/questions/42371164/how-to-run-r-shiny-app-in-full-sized-window

Usage

fullScreenUI(id)

Arguments

id

module id.


CaPO4 Edges Generator

Description

Generate edges for the CaPO4 network

Usage

generate_edges(
  components,
  organs,
  regulations,
  diseases,
  organs_edges_size,
  hormones_edges_size
)

Arguments

components

Shiny input CaPO4 component selector. See networkOptions.

organs

Shiny input to toggle organs display. See networkOptions.

regulations

Shiny input to toggle hormone display. See networkOptions.

diseases

Shiny input disease selector. See diseaseSelect.

organs_edges_size

Shiny input for organs edges size. See networkOptions.

hormones_edges_size

Shiny input for hormones edges size. See networkOptions.


CaPO4 Network Generator

Description

Create a CaPO4 network taking nodes and edges as inputs

Usage

generate_network(nodes, edges, usephysics = FALSE, isMobile)

Arguments

nodes

A dataframe of nodes provided by generate_nodes.

edges

A dataframe of edges provided by generate_edges.

usephysics

Whether to use physic. FALSE by default. A visNetwork API parameter.

isMobile

Shiny input checking if the app is running on a cellphone/tablet.


CaPO4 Nodes Generator

Description

Generate nodes for the CaPO4 network

Usage

generate_nodes(
  components,
  organs,
  regulations,
  background,
  diseases,
  organs_nodes_size,
  hormones_nodes_size
)

Arguments

components

Shiny input CaPO4 component selector. See networkOptions.

organs

Shiny input to toggle organs display. See networkOptions.

regulations

Shiny input to toggle hormone display. See networkOptions.

background

Shiny input background selector. See networkOptions.

diseases

Shiny input disease selector. See diseaseSelect.

organs_nodes_size

Shiny input for organs node size. See networkOptions.

hormones_nodes_size

Shiny input for hormones node size. See networkOptions..


Notifications Generator for CaPO4 animations

Description

Generate sequential notification as a function of the selected diseases. All notifications are in the notifications.R file in the inst/entry_level app folder. Used in the infos module.

Usage

generate_notification(simulation, counter, allowed)

Arguments

simulation

Which disease is currently selected. See extract_running_sim.

counter

To determine which notification to display. We expect a counter returned by the networkCaPO4 module.

allowed

Whether to allow simulations. Expect logical value. See infos module.


Generate user fields

Description

Use inside in the userInfo. Function that helps in generating 4 users fields, image, stat1, stat2 and stat3, so as to reinject them in the header userMenu

Usage

generate_userFields(diseases, sliderDisease)

Arguments

diseases

Shiny input disease selector. See diseaseSelect.

sliderDisease

Shiny slider input related to the current disease severity. See plotBox.


CaPO4 glossary server module

Description

Create a CaPO4 glossary

Usage

glossaryCaPO4(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


CaPO4 glossary UI module

Description

Create a CaPO4 glossary

Usage

glossaryCaPO4Ui(id)

Arguments

id

module id.


Help server module

Description

Create the help section

Usage

helpCaPO4(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


Help UI module

Description

Create a help button

Usage

helpCaPO4Ui(id)

Arguments

id

module id.


Info server module

Description

Create modals, alerts, ...

Usage

infos(input, output, session, diseases, animation_counter, regulations)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.

diseases

Shiny input disease selector. See diseaseSelect.

animation_counter

Give the current temporal state of the animation. See networkCaPO4.

regulations

Shiny input to toggle hormone display. See networkOptions.


Info UI module

Description

Create modals, alerts, ...

Usage

infosUi(id)

Arguments

id

module id.


Create a switch input for infosUi

Description

Create a prettySwitch.

Usage

infoSwitch(inputId, label)

Arguments

inputId

Checkbox Input id.

label

Checkbox label.


Produce plots related to vitamin D3 deficiency (hypoD3)

Description

Use inside the plotBox module.

Usage

make_plot_hypoD3(sliderVal, isMobile)

Arguments

sliderVal

Shiny slider input related to the current disease severity. See plotBox.

isMobile

Shiny input useful to scale elements based on the device screen size.


Produce plots related to hypoparathyroidism (hypopara)

Description

Use inside the plotBox module.

Usage

make_plot_hypopara(sliderVal, isMobile)

Arguments

sliderVal

Shiny slider input related to the current disease severity. See plotBox.

isMobile

Shiny input useful to scale elements based on the device screen size.


Produce plots related to primary hyperparathyroidism (php1)

Description

Use inside the plotBox module.

Usage

make_plot_php1(sliderVal, isMobile)

Arguments

sliderVal

Shiny slider input related to the current disease severity. See plotBox.

isMobile

Shiny input useful to scale elements based on the device screen size.


carousel container

Description

Creates a carousel. Adapted from shinydashboardplus to also allow control of the carousel animation

Usage

myCarousel(
  ...,
  id,
  indicators = TRUE,
  width = 6,
  .list = NULL,
  data.interval = 5000,
  data.ride = "carousel"
)

Arguments

...

Slot for carouselItem

id

Carousel id. Must be unique.

indicators

Whether to display left and right indicators.

width

Carousel width. 6 by default.

.list

Should you need to pass carouselItem via lapply or similar, put these item here instead of passing them in ...

data.interval

specify data-interval in ms. 5000ms by default, set to "false" to prevent automated animation of the slides.

data.ride

specify data-ride. "carousel" by default.


CaPO4 Network server module

Description

Create a CaPO4 network

Usage

networkCaPO4(
  input,
  output,
  session,
  isMobile,
  components,
  organs,
  regulations,
  background,
  diseases,
  organs_nodes_size,
  hormones_nodes_size,
  organs_edges_size,
  hormones_edges_size,
  help
)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.

isMobile

Shiny input checking if the app is running on a cellphone/tablet.

components

Shiny input CaPO4 component selector. See networkOptions.

organs

Shiny input to toggle organs display. See networkOptions.

regulations

Shiny input to toggle hormone display. See networkOptions.

background

Shiny input background selector. See networkOptions.

diseases

Shiny input disease selector. See diseaseSelect.

organs_nodes_size

Shiny input for organs node size. See networkOptions.

hormones_nodes_size

Shiny input for hormones node size. See networkOptions.

organs_edges_size

Shiny input for organs edges size. See networkOptions.

hormones_edges_size

Shiny input for hormones edges size. See networkOptions.

help

Help input.


CaPO4 Network UI module

Description

Create a CaPO4 network

Usage

networkCaPO4Ui(id)

Arguments

id

module id.


CaPO4 Network Options server module

Description

Create a CaPO4 network options

Usage

networkOptions(input, output, session, mobile)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.

mobile

Whether we are on cellphone/tablets or not. Slot for input$ismobile().


CaPO4 Network Options UI module

Description

Options for the network

Usage

networkOptionsUi(id)

Arguments

id

module id


plot box server module

Description

Create modals, alerts, ...

Usage

plotBox(input, output, session, diseases, help, isMobile)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.

diseases

Shiny input disease selector. See diseaseSelect.

help

Help input.

isMobile

Shiny input useful to scale elements based on the device screen size.


plot box UI module

Description

Create modals, alerts, ...

Usage

plotBoxUi(id)

Arguments

id

module id.


Launch the virtual patient simulator

Description

Unleash the virtual patient simulator

Usage

run_CaPO4Sim(context = c("introduction", "virtual-patient"))

Arguments

context

Choose between c("introduction", "virtual-patient").

Examples

if (interactive()) {
 run_CaPO4Sim(context = "introduction")
 run_CaPO4Sim(context = "virtual-patient")
}

Dashboard skin selector, server side

Description

Select the shinydashboard skin you want

Usage

skinSelect(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


Dashboard skin selector, ui side

Description

Select the shinydashboard skin you want

Usage

skinSelectUi(id)

Arguments

id

module id.


CaPO4 user info server module

Description

Create a CaPO4 user info card

Usage

userInfo(input, output, session, diseases, sliderDisease, help)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.

diseases

Shiny input disease selector. See diseaseSelect.

sliderDisease

Shiny input disease severity selector. See plotBox.

help

Help input.


CaPO4 user info UI module

Description

Create a CaPO4 user info card

Usage

userInfoUi(id)

Arguments

id

module id.


Create a video server logic

Description

Nothing is contained inside for now...

Usage

video(input, output, session)

Arguments

input

Shiny inputs

output

Shiny Outputs

session

Session object.


Create a movie UI module

Description

Contains php1, hypopara, hypoD3

Usage

videoUi(id, data)

Arguments

id

module id.

data

Video data.