Skip to content

Commit

Permalink
Merge branch 'main' into 898_save_app_state3@main
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinteractive authored May 7, 2024
2 parents 05787c1 + b36c67e commit 9be50ff
Show file tree
Hide file tree
Showing 55 changed files with 5,051 additions and 158 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ coverage.*
^\.pre-commit-config\.yaml$
data-raw/data.R
^pkgdown$
^.revdeprefs\.yaml$
^revdep$
^\.covrignore$
17 changes: 16 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,21 @@ jobs:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=10
NOT_CRAN=true
additional-r-cmd-check-params: --as-cran
r-cmd-non-cran:
name: R CMD Check (non-CRAN) 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
additional-env-vars: |
NOT_CRAN=true
enforce-note-blocklist: true
publish-unit-test-report-gh-pages: false
junit-xml-comparison: false
concurrency-group: non-cran
disable-unit-test-reports: true
skip-r-cmd-install: true
coverage:
name: Coverage 📔
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
Expand Down Expand Up @@ -76,6 +89,8 @@ jobs:
uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main
with:
auto-update: true
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
grammar:
if: github.event_name != 'push'
name: Grammar Check 🔤
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CLA 🔏

on:
issue_comment:
types:
- created
# For PRs that originate from forks
pull_request_target:
types:
- opened
- closed
- synchronize

jobs:
CLA:
name: CLA 📝
uses: insightsengineering/.github/.github/workflows/cla.yaml@main
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: On-demand 🧑‍🔬

on:
schedule:
- cron: '45 3 * * 0'
workflow_dispatch:

jobs:
revdepcheck:
name: revdepcheck ↩️
uses: insightsengineering/r.pkg.template/.github/workflows/revdepcheck.yaml@main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ docs/

# shinytest2: Ignore new debug snapshots for `$expect_values()`
*_.new.png
tests/testthat/_snaps/**/*.new.md
tests/testthat/_snaps/**/*.new.svg
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.0
rev: v0.4.2
hooks:
- id: style-files
name: Style code with `styler`
Expand Down Expand Up @@ -59,6 +59,7 @@ repos:
.*\.svg|
.*\.xml|
(.*/|)\_pkgdown.y[a]?ml|
(.*/|)\.covrignore|
(.*/|)\.gitignore|
(.*/|)\.gitlab-ci\.y[a]?ml|
(.*/|)\.lintr|
Expand Down Expand Up @@ -122,7 +123,7 @@ repos:
design/.*
)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1000"]
Expand Down
21 changes: 11 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal.modules.hermes
Title: RNA-Seq Analysis Modules to Add to a Teal Application
Version: 0.1.6.9007
Date: 2024-03-20
Version: 0.1.6.9013
Date: 2024-04-30
Authors@R: c(
person("Daniel", "Sabanés Bové", , "[email protected]", role = c("aut", "cre")),
person("Nikolas", "Burkoff", role = "aut"),
Expand All @@ -29,39 +29,40 @@ URL: https://insightsengineering.github.io/teal.modules.hermes/,
BugReports:
https://github.com/insightsengineering/teal.modules.hermes/issues
Depends:
ggplot2,
R (>= 4.1),
ggplot2,
shiny,
teal (>= 0.15.0)
Imports:
checkmate,
DT,
MultiAssayExperiment,
S4Vectors,
SummarizedExperiment,
checkmate,
edgeR,
forcats,
hermes (>= 1.7.1),
lifecycle,
MultiAssayExperiment,
rtables (>= 0.5.1),
S4Vectors,
shinyRadioMatrix (>= 0.2.1),
shinyWidgets,
stats,
stringr,
SummarizedExperiment,
teal.data (>= 0.3.0.9018),
teal.logger (>= 0.1.3.9013),
teal.reporter (>= 0.2.0),
teal.widgets (>= 0.4.0),
tern (>= 0.7.10)
tern (>= 0.7.10),
utils
Suggests:
BiocStyle,
R6,
covr,
dplyr,
globals,
knitr,
logger (>= 0.2.0),
matrixStats,
R6,
rmarkdown,
rvest,
shinytest2 (>= 0.2.0),
Expand All @@ -70,11 +71,11 @@ VignetteBuilder:
knitr
RdMacros:
lifecycle
biocViews:
Config/Needs/website: insightsengineering/nesttemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
biocViews:
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ import(teal.data)
importFrom(S4Vectors,DataFrame)
importFrom(S4Vectors,setListElement)
importFrom(lifecycle,deprecate_soft)
importFrom(utils,str)
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal.modules.hermes 0.1.6.9007
# teal.modules.hermes 0.1.6.9013

### Miscellaneous
* Added placeholders for `assaySpec`, `adtteSpec` and `geneSpec` inputs when no option is selected.
Expand Down
1 change: 1 addition & 0 deletions R/argument_convention.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#' @param plot_width (`list`)\cr list of integers to set the default, minimum,
#' and maximum plot width.
#' @param filter_panel_api (`FilterPanelAPI`)\cr object describing the actual filter panel API.
#' @param .test (`flag`)\cr whether to display the internal structure of the plot for testing purposes.
#'
#' @name module_arguments
#' @keywords internal
Expand Down
35 changes: 27 additions & 8 deletions R/barplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,33 @@ tm_g_barplot <- function(label,
Max = matrixStats::colMaxs
),
pre_output = NULL,
post_output = NULL) {
post_output = NULL,
.test = FALSE) {
message("Initializing tm_g_barplot")
assert_string(label)
assert_string(mae_name)
assert_character(exclude_assays)
assert_summary_funs(summary_funs)
assert_tag(pre_output, null.ok = TRUE)
assert_tag(post_output, null.ok = TRUE)
assert_flag(.test)

module(
label = label,
server = srv_g_barplot,
server_args = list(
mae_name = mae_name,
exclude_assays = exclude_assays,
summary_funs = summary_funs
summary_funs = summary_funs,
.test = .test
),
ui = ui_g_barplot,
ui_args = list(
mae_name = mae_name,
summary_funs = summary_funs,
pre_output = pre_output,
post_output = post_output
post_output = post_output,
.test = .test
),
datanames = mae_name
)
Expand All @@ -69,7 +73,8 @@ ui_g_barplot <- function(id,
mae_name,
summary_funs,
pre_output,
post_output) {
post_output,
.test = FALSE) {
ns <- NS(id)
teal.widgets::standard_layout(
encoding = tags$div(
Expand Down Expand Up @@ -101,7 +106,10 @@ ui_g_barplot <- function(id,
)
)
),
output = teal.widgets::plot_with_settings_ui(ns("plot")),
output = div(
if (.test) verbatimTextOutput(ns("table")) else NULL,
teal.widgets::plot_with_settings_ui(ns("plot"))
),
pre_output = pre_output,
post_output = post_output
)
Expand All @@ -116,11 +124,13 @@ srv_g_barplot <- function(id,
reporter,
mae_name,
exclude_assays,
summary_funs) {
summary_funs,
.test = FALSE) {
with_reporter <- !missing(reporter) && inherits(reporter, "Reporter")
assert_class(filter_panel_api, "FilterPanelAPI")
checkmate::assert_class(data, "reactive")
checkmate::assert_class(shiny::isolate(data()), "teal_data")
assert_flag(.test)
moduleServer(id, function(input, output, session) {
ns <- session$ns

Expand Down Expand Up @@ -191,6 +201,13 @@ srv_g_barplot <- function(id,
plot_r = plot_r
)

if (.test) {
table_r <- reactive({
utils::str(layer_data(plot_r()))
})
output$table <- renderPrint(table_r())
}

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
Expand Down Expand Up @@ -232,6 +249,7 @@ srv_g_barplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}

card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand All @@ -248,14 +266,15 @@ srv_g_barplot <- function(id,
#' if (interactive()) {
#' sample_tm_g_barplot()
#' }
sample_tm_g_barplot <- function() {
sample_tm_g_barplot <- function(.test = FALSE) {
data <- teal.data::teal_data(MAE = hermes::multi_assay_experiment)
app <- teal::init(
data = data,
modules = teal::modules(
tm_g_barplot(
label = "barplot",
mae_name = "MAE"
mae_name = "MAE",
.test = .test
)
)
)
Expand Down
Loading

0 comments on commit 9be50ff

Please sign in to comment.