Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/package-versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
any::Seurat@4.1.1, any::Matrix@1.5.1
28 changes: 17 additions & 11 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, dev, DEV]
branches: [ main, master, dev, DEV ]
pull_request:
branches: [main, master, dev, DEV]
branches: [ main, master, dev, DEV ]
workflow_dispatch:

name: R-CMD-check
Expand All @@ -19,35 +19,40 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: '4.1.3' }
- { os: ubuntu-latest, r: "4.1.3" }
#- { os: ubuntu-latest, r: 'oldrel-1' }
#- { os: macos-latest, r: 'release' }
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
container:
image: nciccbr/scworkflow:v1.0.2_79e5d37
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r-dependencies@v2

- uses: CCBR/actions/install-r-pak@main
with:
versions-file: .github/package-versions.txt
extra-packages: local::.
needs: dev
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

lint:
runs-on: ubuntu-latest
container:
image: nciccbr/scworkflow:v1.0.2_79e5d37
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r-dependencies@v2

- uses: CCBR/actions/install-r-pak@main
with:
r-version: 4.1.3
versions-file: .github/package-versions.txt
needs: dev

- name: Good Practice checks
shell: Rscript {0}
run: |
Expand Down Expand Up @@ -103,11 +108,12 @@ jobs:
name: coverage-test-failures
path: ${{ runner.temp }}/package

check: # make sure all check jobs pass. https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
check:
# make sure all check jobs pass. https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
runs-on: ubuntu-latest
container:
image: nciccbr/scworkflow:v1.0.2_79e5d37
needs: [R-CMD-check, lint, test-coverage]
needs: [ R-CMD-check, lint, test-coverage ]
if: always()
steps:
- name: Successful build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
BUILD_DATE=${{ steps.vars.outputs.DATE }}
BUILD_TAG=${{ steps.vars.outputs.VERSION_TAG }}
REPONAME=${{ env.IMAGE_NAME }}
R_VERSION=4.3.2
R_VERSION=4.1.3
11 changes: 6 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [ main, master ]
pull_request:
branches: [main, master]
branches: [ main, master ]
release:
types: [published]
types: [ published ]
workflow_dispatch:

name: pkgdown
Expand All @@ -27,9 +27,10 @@ jobs:
image: nciccbr/scworkflow:v1.0.2_79e5d37
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r-dependencies@v2
- uses: CCBR/actions/install-r-pak@main
with:
r-version: 4.1.3
versions-file: .github/package-versions.txt
extra-packages: local::.
needs: dev

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, dev, DEV]
pull_request:
branches: [main, master, dev, DEV]

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: CCBR/actions/install-r-pak@main
with:
r-version: 4.1.3
versions-file: .github/package-versions.txt
needs: dev

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ tests/testthat/fixtures/
tests/testthat/output/

.Rproj.user

inst/doc
/doc/
/Meta/

.github.zip
decision_log.md

25 changes: 23 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Imports:
callr (>= 3.7.1),
celldex,
colorspace,
colorspace,
ComplexHeatmap (>= 2.10.0),
cowplot (>= 1.1.1),
data.table (>= 1.14.2),
Expand All @@ -52,23 +51,45 @@ Imports:
ggplot2 (>= 3.3.6),
ggpubr (>= 0.4.0),
ggrepel,
globals (>= 0.16.1),
gridBase (>= 0.4-7),
gridExtra (>= 2.3),
gtable (>= 0.3.1),
harmony (>= 0.1.1),
hdf5r (>= 1.3.5),
htmlwidgets,
httpuv (>= 1.6.5),
httr,
jsonlite,
leiden (>= 0.4.2),
limma (>= 3.50.3),
magrittr (>= 2.0.3),
markdown (>= 1.1),
MAST (>= 1.20.0),
patchwork,
methods (>= 4.1.3),
pheatmap,
plotly (>= 4.10.0),
plyr,
png,
progressr (>= 0.10.1),
purrr (>= 0.3.4),
quantmod (>= 0.4.20),
RColorBrewer (>= 1.1-3),
reshape2 (>= 1.4.4),
reticulate (>= 1.25),
rlang (>= 1.0.6),
scales,
scDblFinder,
Seurat (>= 4.1.1),
SingleR (>= 1.8.1),
statmod (>= 1.4.37),
stringr (>= 1.4.1),
svglite (>= 2.1.0),
tibble (>= 3.1.8),
tidyr,
tidyverse (>= 1.3.2),
viridisLite (>= 0.4.0),
xfun (>= 0.32),
zip (>= 2.2.0)
Suggests:
knitr,
Expand Down
130 changes: 115 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,139 @@ RUN conda config --add channels conda-forge \
&& conda config --set channel_priority strict

# install conda packages
RUN mamba install -y -c conda-forge \
# Note: Most version pins removed to allow conda to resolve compatible versions with R 4.1.3
# Only R version is pinned per requirement
RUN mamba install -y \
r-base=${R_VERSION} \
r-devtools \
r-anndata \
r-biocmanager \
r-callr \
bioconductor-celldex \
r-colorspace \
bioconductor-complexheatmap \
r-cowplot \
r-data.table \
r-dendextend \
r-dendsort \
r-digest \
r-dplyr \
bioconductor-edger \
r-future \
r-future.apply \
r-gargle \
r-gdata \
r-ggextra \
r-ggplot2 \
r-ggrepel r-viridis r-upsetr r-patchwork r-plotly \
r-matrix r-mgcv r-survival \
bioconductor-genomicranges \
bioconductor-summarizedexperiment \
bioconductor-delayedarray \
bioconductor-s4arrays \
bioconductor-annotationdbi \
bioconductor-annotate \
bioconductor-keggrest \
r-ggpubr \
r-ggrepel \
r-globals \
r-gridbase \
r-gridextra \
r-gtable \
r-harmony \
r-hdf5r \
r-htmlwidgets \
r-httpuv \
r-httr \
r-jsonlite \
r-leiden \
bioconductor-limma \
r-magrittr \
r-markdown \
bioconductor-mast \
r-pheatmap \
r-plotly \
r-plyr \
r-png \
r-progressr \
r-purrr \
r-quantmod \
r-rcolorbrewer \
r-reshape2 \
r-reticulate \
r-rlang \
r-scales \
bioconductor-scdblfinder \
r-seurat=4.1.1 \
bioconductor-singler \
r-statmod \
r-stringr \
r-svglite \
r-tibble \
r-tidyr \
r-tidyverse \
r-viridislite \
r-xfun \
r-zip \
r-knitr \
r-rmarkdown \
r-roxygen2 \
r-testthat \
r-usethis \
r-cffr \
r-covr \
r-goodpractice \
r-here \
r-lintr \
r-pkgdown \
r-rcmdcheck \
&& conda clean -afy

# install R package
COPY . /opt2/SCWorkflow
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, repos='http://cran.rstudio.com')"
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, upgrade = 'never', repos='http://cran.rstudio.com')"

# add scworkflow exec to the path
# RUN chmod -R +x /opt2/conda/lib/R/library/SCWorkflow/exec
# ENV PATH="$PATH:/opt2/conda/lib/R/library/SCWorkflow/exec"
# RUN scworkflow --help

# copy example script & json to data
COPY ./inst/extdata/example_script.sh /data2/
COPY ./inst/extdata/json_args/ /data2/json_args/
# COPY ./inst/extdata/example_script.sh /data2/
# COPY ./inst/extdata/json_args/ /data2/json_args/

# Save Dockerfile in the docker
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}

# Verify all dependencies from DESCRIPTION are installed
RUN cat > /tmp/check_description_deps.R << 'EOF'
# Parse DESCRIPTION file and check if all dependencies are installed
desc_file <- "/opt2/SCWorkflow/DESCRIPTION"
if (!file.exists(desc_file)) {
stop("DESCRIPTION file not found at ", desc_file)
}
# Read and parse DESCRIPTION
desc <- read.dcf(desc_file)
# Extract dependencies
extract_packages <- function(str) {
if (is.na(str) || str == "") return(character(0))
# Split by comma and clean up whitespace and version specs
pkgs <- strsplit(str, ",")[[1]]
pkgs <- trimws(pkgs)
pkgs <- gsub("\\s*\\(.*\\)$", "", pkgs) # Remove version specs
pkgs <- pkgs[pkgs != ""]
pkgs
}
deps <- unique(c(
extract_packages(desc[1, "Depends"]),
extract_packages(desc[1, "Imports"]),
extract_packages(desc[1, "Suggests"]),
extract_packages(desc[1, "Config/Needs/dev"])
))
# Remove base R
deps <- deps[!grepl("^R$", deps)]
# Check if each dependency is installed
missing <- deps[!vapply(deps, requireNamespace, quietly = TRUE, FUN.VALUE = logical(1))]
if (length(missing) > 0) {
stop("The following dependencies are missing: ", paste(missing, collapse = ", "))
} else {
message("All dependencies are installed.")
}
EOF
RUN R --vanilla --slave --file=/tmp/check_description_deps.R

# cleanup
WORKDIR /data2
RUN apt-get clean && apt-get purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Loading
Loading