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

Deploy conda pkg and Docker image #125

Merged
merged 12 commits into from
Nov 22, 2023
6 changes: 5 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[bumpversion]
current_version = 0.4.9
current_version = 0.5.0
commit = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.{dev}
{major}.{minor}.{patch}

[bumpversion:file:DESCRIPTION]
search = Version: {current_version}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/conda_docker_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ name: conda-docker-docs
on:
push:
branches:
- conda
- deploy_0.5.0
- rnasum-rpackage
env:
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
recipe_path: deploy/conda/recipe
env_yaml_path: deploy/conda/env/yaml
env_lock_path: deploy/conda/env/lock
VERSION: '0.4.9' # versioned by bump2version
VERSION: '0.5.0' # versioned by bump2version

jobs:
condarise-dockerise-document:
Expand All @@ -27,21 +28,23 @@ jobs:
- name: Micromamba setup
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.9-0'
environment-file: ${{ env.env_yaml_path }}/condabuild.yaml
- name: 🐍 Conda pkg build and upload
run: |
conda mambabuild --R 4.2 ${recipe_path} --token ${atoken}
conda mambabuild ${recipe_path} -c umccr -c conda-forge -c bioconda --token ${atoken}
- name: 🔒 Conda lock
run: |
conda-lock --file ${env_yaml_path}/rnasum.yaml --platform linux-64
mv conda-lock.yml ${env_lock_path}/conda-lock.yml
# 1. generate a combined lock file
# 2. render platform-specific locks
conda-lock lock --file ${env_yaml_path}/rnasum.yaml -p osx-64 -p linux-64
conda-lock render --kind explicit -p osx-64 -p linux-64 conda-lock.yml --filename-template 'rnasum-{platform}.lock' && rm conda-lock.yml
mv rnasum-*.lock ${env_lock_path}/
- name: 💾 Commit lockfile
run: |
git status
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
MSG="[bot] Updating conda-lock file (v${VERSION})"
MSG="[bot] Updating conda-lock files (v${VERSION})"
git add .
git commit -m "${MSG}"
git push
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RNAsum
Title: A Robust Tool for Performing Transcriptome Profiling on Cancer Data
Version: 0.4.9
Version: 0.5.0
Authors@R:
c(person(given = "Sehrish",
family = "Kanwal",
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN mamba config \
mamba clean --all --force-pkgs-dirs

ARG ENV_NAME="rnasum_env"
COPY ./deploy/conda/env/lock/conda-lock.yml .
RUN conda-lock install --name ${ENV_NAME} conda-lock.yml && \
mamba clean --all --force-pkgs-dirs && \
rm conda-lock.yml
ARG LOCK_FILE="rnasum-linux-64.lock"
COPY ./deploy/conda/env/lock/${LOCK_FILE} .
RUN conda-lock install --name ${ENV_NAME} ${LOCK_FILE} && \
mamba clean --all --force-pkgs-dirs

ARG MAMBA_PREFIX="/opt/conda"
ENV PATH="${MAMBA_PREFIX}/envs/${ENV_NAME}/bin:${PATH}"
Expand Down
336 changes: 336 additions & 0 deletions deploy/conda/env/lock/rnasum-linux-64.lock

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions deploy/conda/env/lock/rnasum-osx-64.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/conda/env/yaml/rnasum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ channels:
- bioconda

dependencies:
- r-rnasum ==0.4.9 # versioned by bump2version
- r-rnasum ==0.5.0 # versioned by bump2version
14 changes: 7 additions & 7 deletions deploy/conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: r-rnasum
version: 0.4.9 # bump2version
version: 0.5.0 # bump2version

source:
path: ../../../
Expand Down Expand Up @@ -31,12 +31,12 @@ requirements:
- r-ggforce
- r-ggplot2
- r-glue
- r-gpgr
- umccr::r-gpgr
- r-htmltools
- r-htmlwidgets
- r-knitr
- bioconductor-limma ==3.50.1
- r-manhattanly # grab for R v4.1 from umccr
- umccr::r-manhattanly # grab for R v4.1 from umccr
- r-matrixstats ==0.61.0
- r-optparse
- r-pdftools
Expand All @@ -48,7 +48,7 @@ requirements:
- r-readr
- r-rlang
- r-rmarkdown
- r-rnasum.data
- umccr::r-rnasum.data
- r-scales
- r-sessioninfo
- r-stringr
Expand All @@ -71,12 +71,12 @@ requirements:
- r-ggforce
- r-ggplot2
- r-glue
- r-gpgr
- umccr::r-gpgr
- r-htmltools
- r-htmlwidgets
- r-knitr
- bioconductor-limma ==3.50.1
- r-manhattanly # grab for R v4.1 from umccr
- umccr::r-manhattanly # grab for R v4.1 from umccr
- r-matrixstats ==0.61.0
- r-optparse
- r-pdftools
Expand All @@ -88,7 +88,7 @@ requirements:
- r-readr
- r-rlang
- r-rmarkdown
- r-rnasum.data
- umccr::r-rnasum.data
- r-scales
- r-sessioninfo
- r-stringr
Expand Down
9 changes: 3 additions & 6 deletions inst/cli/rnasum.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ option_list <- list(
make_option("--drugs", action = "store_true", help = "Include drug matching section in report."),
make_option("--filter", action = "store_true", help = "Filter out low expressed genes."),
make_option("--immunogram", action = "store_true", help = "Include immunogram in report."),
make_option("--log", action = "store_true", default = TRUE, help = "Log2 transform data before normalisation."),
make_option("--log", action = "store_true", help = "Log2 transform data before normalisation."),
make_option("--manta_tsv", type = "character", help = "File path to umccrise 'manta.tsv' output."),
make_option("--norm", type = "character", help = "Normalisation method."),
make_option("--pcgr_splice_vars", action = "store_true", help = "Include non-coding splice region variants reported in PCGR."),
Expand All @@ -45,8 +45,7 @@ option_list <- list(
make_option("--top_genes", default = 5, type = "integer", help = "Number of top ranked genes to be presented in report."),
make_option("--transform", default = "CPM", type = "character", help = "Transformation method to be used when converting read counts. [def: %default]"),
make_option("--umccrise", type = "character", help = "Directory path of the corresponding WGS-related umccrise data."),
make_option(c("--version", "-v"), action = "store_true", help = "Print RNAsum version and exit."),
make_option("--html_dir", type = "character", default = getwd(), help = "Directory path to output final HTML report. [def: current directory (%default)]")
make_option(c("--version", "-v"), action = "store_true", help = "Print RNAsum version and exit.")
)

parser <- optparse::OptionParser(option_list = option_list, formatter = optparse::TitledHelpFormatter)
Expand All @@ -59,8 +58,6 @@ if (!is.null(opt$version)) {
# don't need these any more so NULLify to remove from params
opt$version <- NULL
opt$help <- NULL
html_dir <- opt$html_dir
opt$html_dir <- NULL

##### Convert missing flags to FALSE
flags <- c("batch_rm", "dataset_name_incl", "drugs", "filter", "immunogram", "log", "pcgr_splice_vars", "save_tables")
Expand Down Expand Up @@ -114,7 +111,7 @@ if (opt$transform == "TPM" && !(opt$norm %in% c("quantile", "none"))) {
dataset_name_incl <- ifelse(opt$dataset_name_incl, glue::glue("_{opt$dataset}"), "")
out_file_base <- glue::glue("{opt$sample_name}{toupper(dataset_name_incl)}.RNAseq_report")
out_html <- RNAsum::rnasum_rmd(
out_file = file.path(html_dir, glue::glue("{out_file_base}.html")),
out_file = file.path(opt$report_dir, glue::glue("{out_file_base}.html")),
pars = opt
)
message(glue::glue("RNAsum HTML output at: {out_html}"))