Skip to content

Commit b6c0afb

Browse files
committed
changes from git pull
2 parents 9366b2e + 6e80367 commit b6c0afb

12 files changed

Lines changed: 160 additions & 76 deletions

File tree

.github/workflows/docker.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ name: docker
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version_tag:
7+
type: string
8+
description: Container version tag. If not set, it will be created automatically based on the released version and commit hash.
9+
required: false
10+
default: ''
511
release:
612
types: [published]
713

814
env:
915
IMAGE_NAME: "scworkflow" # must be lowercase
1016
CONTEXT: "./"
1117
NAMESPACE: "nciccbr"
18+
USE_INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version_tag != '' }}
1219

1320
permissions: read-all
1421

@@ -23,9 +30,15 @@ jobs:
2330
echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_OUTPUT"
2431
2532
if [ '${{ github.event_name }}' == 'release' ]; then
33+
# include latest tag since this is a release
2634
VERSION=${{ github.ref_name }}
2735
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION},${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
36+
elif [ '${{ env.USE_INPUT_TAG }}' == 'true' ]; then
37+
# use manual tag
38+
VERSION=${{ github.event.inputs.version_tag }}
39+
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION}
2840
else
41+
# set tag from last release and current commit
2942
HASH=$(git rev-parse --short HEAD)
3043
VERSION="$(grep 'Version:' $CONTEXT/DESCRIPTION | sed 's/Version: /v/')_${HASH}"
3144
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION}
@@ -35,9 +48,9 @@ jobs:
3548
3649
- name: debug
3750
run: |
38-
echo "the github tag is ${{ github.ref_name }}"
39-
echo "github event_name is ${{ github.event_name }}"
40-
echo "the version tag is ${{ steps.vars.outputs.VERSION_TAG }}"
51+
echo "Github tag: ${{ github.ref_name }}"
52+
echo "Github event_name: ${{ github.event_name }}"
53+
echo "Container version tag: ${{ steps.vars.outputs.VERSION_TAG }}"
4154
4255
- name: Login to DockerHub
4356
if: ${{ github.event_name != 'pull_request' }}
@@ -49,11 +62,10 @@ jobs:
4962
uses: docker/build-push-action@v4
5063
with:
5164
push: ${{ github.event_name != 'pull_request' }}
52-
tags: ${{ steps.vars.outputs.DOCKER_TAGS }} # include 'latest' tag if this is a release
65+
tags: ${{ steps.vars.outputs.DOCKER_TAGS }}
5366
context: ${{ env.CONTEXT }}
5467
file: ${{ env.CONTEXT }}/Dockerfile
5568
build-args: |
5669
BUILD_DATE=${{ steps.vars.outputs.DATE }}
5770
BUILD_TAG=${{ steps.vars.outputs.VERSION_TAG }}
5871
REPONAME=${{ env.IMAGE_NAME }}
59-
R_VERSION=4.3.2

DESCRIPTION

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Depends:
2929
R (>= 4.0)
3030
Imports:
3131
anndata (>= 0.7.5.2),
32-
BiocManager,
3332
callr (>= 3.7.1),
3433
celldex,
3534
colorspace,
@@ -65,6 +64,7 @@ Imports:
6564
magrittr (>= 2.0.3),
6665
markdown (>= 1.1),
6766
MAST (>= 1.20.0),
67+
Matrix,
6868
methods (>= 4.1.3),
6969
pheatmap,
7070
plotly (>= 4.10.0),
@@ -80,9 +80,16 @@ Imports:
8080
rlang (>= 1.0.6),
8181
scales,
8282
scDblFinder,
83+
<<<<<<< HEAD
8384
Seurat (== 4.3.0),
8485
SeuratObject (== 4.1.3),
8586
Matrix (>= 1.6.1),
87+
=======
88+
Seurat (< 5.0.0),
89+
Seurat (>= 4.3.0),
90+
SeuratObject (< 5.0.0),
91+
SeuratObject (>= 4.1.3),
92+
>>>>>>> 6e803673e7a9d5a6e43342924bf3c18b8fee4fdf
8693
SingleR (>= 1.8.1),
8794
statmod (>= 1.4.37),
8895
stringr (>= 1.4.1),

Dockerfile

Lines changed: 115 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nciccbr/ccbr_ubuntu_22.04:v4
1+
FROM rocker/tidyverse:4.3.2
22

33
# build time variables
44
ARG BUILD_DATE="000000"
@@ -8,65 +8,130 @@ ENV BUILD_TAG=${BUILD_TAG}
88
ARG REPONAME="000000"
99
ENV REPONAME=${REPONAME}
1010

11-
ARG R_VERSION=4.3.2
12-
ENV R_VERSION=${R_VERSION}
13-
1411
SHELL ["/bin/bash", "-lc"]
1512

16-
# Install conda and give write permissions to conda folder
17-
RUN echo 'export PATH=/opt2/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
18-
wget --quiet "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" -O ~/miniforge3.sh && \
19-
/bin/bash ~/miniforge3.sh -b -p /opt2/conda && \
20-
rm ~/miniforge3.sh && chmod 777 -R /opt2/conda/
21-
ENV PATH="/opt2/conda/bin:$PATH"
22-
23-
# Pin channels and update
24-
RUN conda config --add channels conda-forge \
25-
&& conda config --add channels bioconda \
26-
&& conda config --set channel_priority strict
13+
RUN chmod 777 /usr/local/lib/R/site-library /usr/local/lib/R/library
2714

28-
# install conda packages
29-
RUN mamba install -y -c conda-forge \
30-
r-base=${R_VERSION} \
31-
r-devtools r-testthat \
32-
r-anndata \
33-
r-callr r-colorspace r-cowplot \
34-
r-data.table r-dendextend r-dendsort r-digest r-dplyr \
35-
r-future r-future.apply \
36-
r-gargle r-gdata r-ggExtra r-ggplot2 r-ggpubr r-ggrepel r-globals r-glue r-gridBase r-gridExtra r-gtable \
37-
r-harmony r-hdf5r r-htmlwidgets r-httpuv r-httr \
38-
r-jsonlite \
39-
r-leiden \
40-
r-magrittr r-markdown r-MAST r-methods \
41-
r-pheatmap r-plotly r-plyr r-png r-progressr r-pryr r-purrr \
42-
r-quantmod \
43-
r-RColorBrewer r-reshape2 r-reticulate r-rlang \
44-
r-scales r-Seurat r-statmod r-stringr r-svglite \
45-
r-tibble r-tidyr r-tidyverse \
46-
r-viridisLite \
47-
r-xfun \
48-
r-zip \
49-
bioconductor-celldex bioconductor-ComplexHeatmap \
50-
bioconductor-edger \
51-
bioconductor-limma \
52-
bioconductor-scDblFinder bioconductor-SingleR \
53-
bioconductor-genomicranges \
54-
bioconductor-summarizedexperiment \
55-
&& conda clean -afy
15+
# https://github.com/Bioconductor/bioconductor_docker/blob/7335f85420199679432d2a328c3a59b551b6cfd0/bioc_scripts/install_bioc_sysdeps.sh
16+
RUN apt-get update && apt-get upgrade -y && \
17+
apt-get install -y --no-install-recommends --allow-unauthenticated \
18+
automake \
19+
biber \
20+
byacc \
21+
cmake \
22+
coinor-libcgl-dev \
23+
coinor-libsymphony-dev \
24+
coinor-libsymphony-doc \
25+
curl \
26+
default-jdk \
27+
default-libmysqlclient-dev \
28+
fortran77-compiler \
29+
ggobi \
30+
graphviz \
31+
imagemagick \
32+
jags \
33+
libapparmor-dev \
34+
libarchive-dev \
35+
libarchive-extract-perl \
36+
libavfilter-dev \
37+
libboost-dev \
38+
libbz2-dev \
39+
libcairo2-dev \
40+
libcgi-pm-perl \
41+
libdbd-mysql-perl \
42+
libdbi-perl \
43+
libeigen3-dev \
44+
libfftw3-dev \
45+
libfile-copy-recursive-perl \
46+
libfuse-dev \
47+
libgdal-dev \
48+
libgeos-dev \
49+
libgit2-dev \
50+
libgl1-mesa-dev \
51+
libglpk-dev \
52+
libglu1-mesa-dev \
53+
libgmp3-dev \
54+
libgsl0-dev \
55+
libgslcblas0 \
56+
libgtk2.0-dev \
57+
libgtkmm-2.4-dev \
58+
libhdf5-dev \
59+
libhdf5-serial-dev \
60+
libhiredis-dev \
61+
libjpeg-dev \
62+
libjpeg-turbo8-dev \
63+
libjpeg8-dev \
64+
liblapack-dev \
65+
liblzma-dev \
66+
libmagick++-dev \
67+
libmodule-build-perl \
68+
libmpfr-dev \
69+
libmysqlclient-dev \
70+
libncurses-dev \
71+
libnetcdf-dev \
72+
libopenbabel-dev \
73+
libopenmpi-dev \
74+
libpcre2-dev \
75+
libperl-dev \
76+
libpng-dev \
77+
libpoppler-cpp-dev \
78+
libpoppler-glib-dev \
79+
libpq-dev \
80+
libproj-dev \
81+
libprotobuf-dev \
82+
libprotoc-dev \
83+
librdf0-dev \
84+
libreadline-dev \
85+
librtmp-dev \
86+
libsasl2-dev \
87+
libsbml5-dev \
88+
libssl-dev \
89+
libtiff5-dev \
90+
libudunits2-dev \
91+
libv8-dev \
92+
libxml-simple-perl \
93+
libxml2-dev \
94+
libxpm-dev \
95+
libxt-dev \
96+
libz-dev \
97+
libzmq3-dev \
98+
mono-runtime \
99+
mpi-default-bin \
100+
ocl-icd-opencl-dev \
101+
openmpi-bin \
102+
openmpi-common \
103+
openmpi-doc \
104+
protobuf-compiler \
105+
python3-pip \
106+
sqlite3 \
107+
tabix \
108+
tcl8.6-dev \
109+
tk-dev \
110+
xfonts-100dpi \
111+
xfonts-75dpi \
112+
liblz4-dev \
113+
automake \
114+
cmake \
115+
default-jre \
116+
g++ \
117+
gcc \
118+
gdb \
119+
gfortran \
120+
libcurl4-gnutls-dev \
121+
make \
122+
pkg-config
56123

57124
# install R package
58125
COPY . /opt2/SCWorkflow
59-
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, repos='http://cran.rstudio.com')"
126+
RUN R -e 'remotes::install_version("Seurat", version="4.3.0"); remotes::install_version("SeuratObject", version="4.1.3")' && \
127+
R -e "remotes::install_local('/opt2/SCWorkflow', dependencies = TRUE, upgrade='never', repos='http://cran.rstudio.com'); library(SCWorkflow)" && \
128+
R -s -e "readr::write_tsv(tibble::as_tibble(installed.packages()), '/mnt/r-packages.tsv')"
60129

61130
# add scworkflow exec to the path
62-
RUN chmod -R +x /opt2/conda/lib/R/library/SCWorkflow/exec
63-
ENV PATH="$PATH:/opt2/conda/lib/R/library/SCWorkflow/exec"
131+
RUN chmod -R +x /usr/local/lib/R/site-library/SCWorkflow/exec
132+
ENV PATH="$PATH:/usr/local/lib/R/site-library/SCWorkflow/exec"
64133
RUN scworkflow --help
65134

66-
# copy example script & json to data
67-
COPY ./inst/extdata/TestRunjson.sh /data2/
68-
COPY ./inst/extdata/json_args/ /data2/json_args/
69-
70135
# Save Dockerfile in the docker
71136
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
72137
RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}

R/cli.R

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ Main functions:
124124
scworkflow heatmapSC
125125
scworkflow tSNE3D
126126
scworkflow dualLabeling
127-
128127
scworkflow harmonyBatchCorrect
129128
"
130129
writeLines(usage, con = con)
@@ -200,35 +199,26 @@ cli_from_json <- function(method, json, debug = FALSE) {
200199
"object_input_rds must be included in the JSON because `object` is required for {method}()"
201200
)
202201
)
203-
# most SCWorkflow functions return a list containing an "object" element plus a list of plots or other output.
204-
# here we extract only the "object" element to pass as the first argument to this function.
205-
object_list <- readr::read_rds(json_args[["object_input_rds"]])
206-
print(paste0("Input List Names: ",paste(names(object_list), collapse = ", ")))
207-
208-
if (!(any(grepl("object|Object", names(object_list))))) {
209-
message('Expected `object_input_rds` to contain an element with the name "object".')
210-
object_list[["object"]] <- object_list
211-
}
212-
fcn_args[[first_arg]] <- object_list[["object"]]
202+
fcn_args[[first_arg]] <- readr::read_rds(json_args[["object_input_rds"]])
213203
}
214204

215205
## If any arguments end in .txt, read them in as tables
216206
## This is a bit hacky, but allows us to pass tables as arguments via json
217207
## Adding logic to unlist parameters that should be vectors ( such as sample names)
218-
219-
for(x in names(json_args)){
208+
for(x in names(json_args)) {
220209
if(any(stringr::str_detect(json_args[[x]], glue::glue(".txt$")))){
221-
json_args[[x]]=read.delim(json_args[[x]])
210+
json_args[[x]] <- read.delim(json_args[[x]])
222211
}else if(any(stringr::str_detect(json_args[[x]], glue::glue(".csv$")))){
223-
json_args[[x]]=read.delim(json_args[[x]], sep=",")
212+
json_args[[x]] <- read.delim(json_args[[x]], sep=",")
224213
}
225-
if(class(json_args[[x]])=='list'){
214+
if(class(json_args[[x]]) == 'list'){
226215
json_args[[x]] <- unlist(json_args[[x]])
227216
}
228217
}
229218

230-
# all other json keys should be arguments for the method
231-
fcn_args <- c(fcn_args, json_args[!stringr::str_detect(names(json_args), "object_.*_rds")])
219+
# remove object_input_rds, object_output_rds, and plot_output_rds.
220+
# all other json keys should be arguments for the method.
221+
fcn_args <- c(fcn_args, json_args[!stringr::str_detect(names(json_args), "object_.*_rds|plot_output_rds")])
232222

233223
# invoke method with parsed arguments from json
234224
expr <- as.call(fcn_args)
@@ -240,7 +230,10 @@ cli_from_json <- function(method, json, debug = FALSE) {
240230

241231
# save result to output_rds
242232
if ("object_output_rds" %in% names(json_args)) {
243-
readr::write_rds(result, json_args[["object_output_rds"]])
233+
readr::write_rds(result[['object']], json_args[["object_output_rds"]])
234+
}
235+
if ("plot_output_rds" %in% names(json_args)) {
236+
readr::write_rds(result[['plot']], json_args[["plot_output_rds"]])
244237
}
245238
}
246239

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_reclusterFilteredSeuratObject.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_colorByGene.rds",
4+
"plot_output_rds": "chariou/plots/colorByGene.rds",
45
"samples.to.include": ["CD8dep","NHSIL12"],
56
"gene": "Cxcl3"
67
}

inst/extdata/json_args/dotPlotMet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_reclusterFilteredSeuratObject.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_dotPlotMet.rds",
4+
"plot_output_rds": "chariou/plots/dotPlotMet.rds",
45
"metadata": "orig.ident",
56
"cells": ["CD8dep","NHSIL12"],
67
"markers": ["Il1b","Cxcr3"]

inst/extdata/json_args/heatmapSC.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_reclusterFilteredSeuratObject.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_heatmapSC.rds",
4+
"plot_output_rds": "chariou/plots/heatmapSC.rds",
45
"sample.names": ["CD8dep","NHSIL12"],
56
"metadata": ["orig.ident","immgen_main"],
67
"transcripts": ["S100a8", "Il1b", "Cxcl3", "Lyz2", "Mmp12", "Cxcl10", "Ccl3", "Thy1", "Tmsb4x", "Cd8b1"]

inst/extdata/json_args/plotMetadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_reclusterFilteredSeuratObject.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_plotMetadata.rds",
4+
"plot_output_rds": "chariou/plots/plotMetadata.rds",
45
"samples.to.include": ["CD8dep","NHSIL12"],
56
"metadata.to.plot": ["orig.ident","pct_counts_in_top_20_genes"],
67
"columns.to.summarize": null
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_filterSeuratObjectByMetadata.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_reclusterFilteredSeuratObject.rds",
4+
"plot_output_rds": "chariou/plots/reclusterFilteredSeuratObject_plots.rds",
45
"old.columns.to.save": null
56
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"object_input_rds": "chariou/SCWorkflowObject_filterSeuratObjectByMetadata.rds",
33
"object_output_rds": "chariou/SCWorkflowObject_reclusterSeuratObject.rds",
4+
"plot_output_rds": "chariou/plots/reclusterSeuratObject.rds",
45
"old.columns.to.save": null
56
}

0 commit comments

Comments
 (0)