Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research - Make a chevron teal module #628

Closed
gogonzo opened this issue May 9, 2022 · 3 comments
Closed

Research - Make a chevron teal module #628

gogonzo opened this issue May 9, 2022 · 3 comments
Assignees

Comments

@gogonzo
Copy link
Contributor

gogonzo commented May 9, 2022

Followup after meeting regarding making teal modules based on the chevron functions. This comment contains all propositions and will be updated each time we find something more.

Initially, three options.

1. Shiny module on the fly

Advantage:

  • full control over creating a module.
  • Doesn't require teal nor chevron to make any changes.
  • If it's a simple input-to-argument process, modules are relatively simple

Disadvantage:

  • App developer must know shiny and how to make a teal module
  • For more complicated apps these modules might take some significant space in preprocessing code
aet_01_ui <- function(id) {
  div(
    numericInput("study", 1:10),
    selectInput("aval", c("a", "b", "c")),
    selectInput("strata", c("a", "b", "c")),
    ...
  )
}
aet_01_srv <- function(input, output, session) {
  validate(need(input$studyid), "You must select study!")
  
  chevron::aet_01(study = input$study, aval = input$aval, strata = input$strata, ...)
}

teal::module(aet_01_ui("<id>"), aet_01_srv("<id>"))

2. Module settings

(1) could be simplified only to the ui inputs which names would be equivalents of the tlg arguments.

Advantages:

  • almost full control over inputs
  • App developer will have to specify ui module and call tm_chevron_srv with chevron function
  • Doesn't require teal nor chevron to make any changes.
  • Could be an addition to (1). Sometimes could be just ui and universal tm_chevron_srv and sometimes app developer would create own server.

Disadvantages:

  • Doesn't give a full control over what goes to the tlg. Does not give an option for validation.
# this guy would be in teal
tm_chevron_srv <- function(input, output, session, ...) {
  # ... for static values/arguments
  do.call(aet_01, shiny::reactiveValuesToList(input))
}

# app dev should do following
aet_01_ui <- function(id) {
  div(
    numericInput("study", 1:10),
    selectInput("aval", c("a", "b", "c")),
    selectInput("strata", c("a", "b", "c")),
    ...
  )
}

teal::module(aet_01_ui("<id>"), tm_chevron_srv("<id>"))
# or simpler
tm_chevron("<id>", aet_01_ui)

3. Automatic deduction

tm_chevron would somehow create ui and server for the tlg basing on it's arguments and possibly some additional instructions. Options does not exclude (1) nor (2) - they can be used interchangeably.

Advantages:

  • Simplest for the app developer.
  • concise code

Disadvantages:

  • Whole burden on the teal which should guess which arguments needs what input
  • S3 (normal R functions) does not share information about type of the argument so teal won't guess what is needed. Probably need to rewrite tlgs to S4
  • Some additional instructions would be required anyway to at least point which arguments need shiny input and which needs static value.
  • No control over shiny inputs, no meaningful validation
tm_chevron(aet_01, <some custom settings>)
@crazycatandy
Copy link

Chevron team to collaborate with TEAL team to share info they may need.

@kumamiao kumamiao changed the title Make a chevron teal module Research - Make a chevron teal module May 24, 2022
@kumamiao kumamiao added the core label May 24, 2022
@kumamiao
Copy link

Notes after discussion with @telepath37 @wangh107, please feel free to add comments here:

Use case for chevron-to-teal is pending discussion, some proposed use cases include:

  • TLG review for stakeholders - This is given that chevron calls are already available (in this case, would imagine the .out files are ready too), then this use case would be similar to previous TLG review tool on Roche Shiny server, in this case, would it probably easier to create a Shiny interface to do that?
  • Subgroup analysis that are enabled by the filtering panel - Q on whether it would worth the efforts to work on this purely for the filtering feature
  • Users who are not familiar with how to set up a Shiny app can directly get a Shiny app without too much efforts - this is a valid point, although would probably still need to consider the business use cases. App creation could be made easier

As chevron would be based on regulatory outputs, it would not fully fit the need for more exploratory analyses. For example, app developers might need to create and maintain 2 apps - one teal app for exploratory modules based on TMC, TMG, etc., and another from chevron. Then the guidance for users for different purposes of the two different apps could lead to potential confusion.

One potential is to combine with the teal add-in issue , to use LoPO tool together with chevron defaults, which will need follow-up discussion.

@kumamiao
Copy link

kumamiao commented Jul 12, 2022

Update: chevron_to_teal will be positioned as a tool designed for standard output review/comment/communication by the study team. Please see the updated proposal here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants