Skip to content

Commit

Permalink
Merge dev on main (#147)
Browse files Browse the repository at this point in the history
Now that the core teal packages are released on CRAN. Our stable
deployments should start using them.
And, all the breaking changes from `dev` can be safely merged on `main`.
Since the module packages are still not released, they will be taken
from GitHub until they are released.

---------

Signed-off-by: Marcin <[email protected]>
Signed-off-by: Vedha Viyash <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: vedhav <[email protected]>
Co-authored-by: Marcin <[email protected]>
Co-authored-by: edelarua <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Co-authored-by: Vedha Viyash <[email protected]>
  • Loading branch information
7 people authored Feb 21, 2024
1 parent 58bbd12 commit 096ae11
Show file tree
Hide file tree
Showing 26 changed files with 3,736 additions and 4,139 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- main
- dev
- deploy
paths:
- RNA-seq/**
- basic-teal/**
Expand All @@ -20,10 +21,6 @@ on:
schedule:
- cron: "12 3 * * *"

concurrency:
group: publish-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
SHINYAPPSIO_ACCOUNT: genentech
APP_PREFIX: NEST
Expand Down Expand Up @@ -120,7 +117,7 @@ jobs:
node-version: 20

- name: Restore renv from cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
CACHE_KEY: renv-${{ runner.arch }}-${{ runner.os }}-${{ matrix.directory }}-${{ matrix.channel }}
with:
Expand All @@ -134,13 +131,18 @@ jobs:
setwd("${{ matrix.directory }}")
lockfile <- renv::lockfile_read()
pkg_name_structure <- ifelse("${{ matrix.channel }}" == "stable", "%s/%s@*release", "%s/%s")
unreleased_packages <- c(
"osprey", "hermes", "goshawk", "teal.modules.general", "teal.modules.clinical",
"teal.osprey", "teal.modules.hermes", "teal.goshawk", "nestcolor"
)
for (package in lockfile$Packages) {
if (package$Source == "GitHub") {
# TODO: After teal.slice is released we have to remove this change.
# This workaround is because update to {bslib} breaks current release of teal.slice
if (package$Package == "teal.slice" && "${{ matrix.channel }}" == "stable") {
renv::record("insightsengineering/teal.slice@103491c67e26a9a85d636bd105a806904a0111ec")
print(package$Package)
if (package$Package %in% unreleased_packages) {
print(paste0("Recording ", package$Package, " from main"))
renv::record(sprintf("%s/%s", package$RemoteUsername, package$Package))
} else {
print(paste0("Recording ", package$Package, " from stable"))
renv::record(sprintf(pkg_name_structure, package$RemoteUsername, package$Package))
}
}
Expand Down Expand Up @@ -200,11 +202,24 @@ jobs:
)
- name: Commit and push changes 📌
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[skip deploy] Update renv.lock file for ${{ matrix.directory }} app"
file_pattern: "${{ matrix.directory }}/renv/activate.R ${{ matrix.directory }}/renv.lock"
commit_user_name: github-actions
commit_user_email: >-
41898282+github-actions[bot]@users.noreply.github.com
continue-on-error: true
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git config --global --add safe.directory /__w/teal.gallery/teal.gallery
git fetch
git stash
git checkout ${{ env.BRANCH_NAME }}
git pull
if [ -n "$(git stash list)" ]; then
git stash apply
else
echo "No stash entries found."
fi
git add ${{ matrix.directory }}/renv.lock
git add ${{ matrix.directory }}/renv/activate.R
if [ -n "$(git diff --staged)" ]; then
git commit -m "[skip deploy] Update renv.lock file for ${{ matrix.directory }} app"
git push origin ${{ env.BRANCH_NAME }}
else
echo "renv.lock was not modified. Nothing to commit."
fi
27 changes: 0 additions & 27 deletions .gitlab-ci.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
linters: with_defaults(line_length_linter(120))
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
object_usage_linter = NULL,
object_name_linter = object_name_linter(c("snake_case", "symbols", "UPPERCASE"))
)
37 changes: 16 additions & 21 deletions RNA-seq/app.R
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
library(teal.modules.hermes)
library(teal.modules.general)
library(scda.2022)
library(nestcolor)

options(shiny.useragg = FALSE)

nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers/main/PNG/nest.png"

# code>
mae <- hermes::multi_assay_experiment
mae_data <- dataset("MAE", mae)
## Data reproducible code ----
data <- teal_data()
data <- within(data, {
library(scda.2022)
library(nestcolor)
ADTTE <- scda::synthetic_cdisc_data("rcd_2022_06_27")$adtte %>%
dplyr::mutate(is_event = CNSR == 0)
MAE <- hermes::multi_assay_experiment
})
datanames(data) <- c("ADTTE", "MAE")

adtte <- scda::synthetic_cdisc_data("rcd_2022_06_27")$adtte %>%
dplyr::mutate(is_event = CNSR == 0)

data <- teal_data(
dataset(
"ADTTE",
adtte,
code = 'adtte <- scda::synthetic_cdisc_data("rcd_2022_06_27")$adtte %>%
dplyr::mutate(is_event = CNSR == 0)'
),
dataset("MAE", mae)
)

app <- init(
data = data,
modules = modules(
tm_front_page(
label = "App Info",
header_text = c("Info about input data source" = "This app uses MultiplAssayExperiment data object randomly generated by `scda`, `scda.2022` & `hermes` R packages"),
header_text = c("Info about input data source" = "This app uses MultiplAssayExperiment data object randomly generated by `scda`, `scda.2022` & `hermes` R packages"), # nolint: line_length.
tables = list(`NEST packages used in this demo app` = data.frame(
Packages = c("teal.modules.hermes", "teal.modules.general", "scda", "scda.2022", "hermes")
))
Expand Down Expand Up @@ -69,9 +61,9 @@ app <- init(
mae_name = "MAE"
)
),
title = build_app_title("RNA-Seq Analysis Teal Demo App", nest_logo),
header = tags$span(
style = "display: flex; align-items: center; justify-content: space-between; margin: 10px 0 10px 0;",
tags$head(tags$link(rel = "shortcut icon", href = nest_logo), tags$title("RNA-Seq Analysis Teal Demo App")),
tags$span(
style = "font-size: 30px;",
"Example teal app focusing on analysis of RNA-seq data with teal.modules.hermes"
Expand Down Expand Up @@ -100,7 +92,10 @@ app <- init(
body(app$server)[[length(body(app$server)) + 1]] <- quote(
observeEvent(input$showAboutModal, {
showModal(modalDialog(
tags$p("This teal app is brought to you by the NEST Team at Roche/Genentech. For more information, please visit:"),
tags$p(
"This teal app is brought to you by the NEST Team at Roche/Genentech.
For more information, please visit:"
),
tags$ul(
tags$li(tags$a(
href = "https://github.com/insightsengineering", "Insights Engineering",
Expand Down
Loading

0 comments on commit 096ae11

Please sign in to comment.