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

Update to R 4.4 & renv 3.19 #273

Merged
merged 14 commits into from
May 3, 2024
Empty file removed .Dockerignore
Empty file.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.git
.Rproj.user
renv/
scpcaTools.Rproj
2 changes: 0 additions & 2 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
- name: Build full image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name == 'push' }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_USER }}/scpcatools:buildcache
Expand Down Expand Up @@ -93,7 +92,6 @@ jobs:
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
target: ${{ matrix.target }}
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
29 changes: 15 additions & 14 deletions docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
##########################
# Build the slim image target first --------------------------------------------
FROM bioconductor/r-ver:3.18 AS slim
FROM bioconductor/r-ver:3.19 AS slim
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title "scpcatools-slim"
LABEL org.opencontainers.image.source https://github.com/AlexsLemonade/scpcaTools

#### R packages
# Use renv for R packages
ENV RENV_CONFIG_CACHE_ENABLED FALSE
RUN Rscript -e "install.packages(c('remotes', 'renv'))"
RUN Rscript -e "install.packages(c('renv'))"

COPY renv_slim.lock renv.lock
COPY docker/renv_slim.lock renv.lock
# restore renv and remove cache files
RUN Rscript -e 'renv::restore()' && \
rm -rf ~/.cache/R/renv && \
rm -rf /tmp/downloaded_packages && \
rm -rf /tmp/Rtmp*

# bust cache if needed
ADD "https://api.github.com/repos/AlexsLemonade/scpcaTools/commits?per_page=1" latest_commit

# Install scpcaTools package (& test loading)
RUN Rscript -e "remotes::install_github('AlexsLemonade/scpcaTools', upgrade = 'never'); \
require(scpcaTools)"
COPY . scpcaTools
RUN R CMD INSTALL scpcaTools/
RUN Rscript -e "require(scpcaTools)"

CMD [ "R" ]
# restore slim renv
COPY docker/renv_slim.lock renv.lock

##########################
# Add Seurat support target ----------------------------------------------------
FROM slim AS seurat
LABEL org.opencontainers.image.title "scpcatools-seurat"

COPY renv_seurat.lock renv.lock
COPY docker/renv_seurat.lock renv.lock
RUN Rscript -e 'renv::restore()' && \
rm -rf ~/.cache/R/renv && \
rm -rf /tmp/downloaded_packages && \
Expand All @@ -42,7 +43,7 @@ RUN Rscript -e 'renv::restore()' && \
FROM slim AS reports
LABEL org.opencontainers.image.title "scpcatools-reports"

COPY renv_reports.lock renv.lock
COPY docker/renv_reports.lock renv.lock
RUN Rscript -e 'renv::restore()' && \
rm -rf ~/.cache/R/renv && \
rm -rf /tmp/downloaded_packages && \
Expand All @@ -54,7 +55,7 @@ RUN Rscript -e 'renv::restore()' && \
FROM slim AS anndata
LABEL org.opencontainers.image.title "scpcatools-anndata"

COPY renv_zellkonverter.lock renv.lock
COPY docker/renv_zellkonverter.lock renv.lock
RUN Rscript -e 'renv::restore()' && \
rm -rf ~/.cache/R/renv && \
rm -rf /tmp/downloaded_packages && \
Expand All @@ -67,7 +68,7 @@ RUN Rscript -e "proc <- basilisk::basiliskStart(env = zellkonverter::zellkonvert
basilisk.utils::cleanConda()"

#### Python packages
COPY requirements_anndata.txt requirements.txt
COPY docker/requirements_anndata.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt


Expand All @@ -76,7 +77,7 @@ RUN pip install --no-cache-dir -r requirements.txt
FROM anndata AS scvi
LABEL org.opencontainers.image.title "scpcatools-scvi"

COPY requirements_scvi.txt requirements.txt
COPY docker/requirements_scvi.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt


Expand All @@ -91,6 +92,6 @@ RUN Rscript -e 'renv::restore()' && \
rm -rf /tmp/downloaded_packages && \
rm -rf /tmp/Rtmp*

COPY requirements.txt requirements.txt
COPY docker/requirements.txt requirements.txt

RUN pip install --no-cache-dir -r requirements.txt
4 changes: 2 additions & 2 deletions R/integrate_sces.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#' Integrate a merged set of SingleCellExperiment objects using a specified
#' integration method. The final SCE object will contain an additional reducedDim
#' entitled `{integration_method}_PCA`. All original SCE assays are retained.
#' entitled `\{integration_method\}_PCA`. All original SCE assays are retained.
#' `fastMNN` integration uses all default setting, but additional parameters can be supplied.
#' `harmony` integration uses existing PCs, but additional parameters can be supplied.
#'
Expand All @@ -27,7 +27,7 @@
#' @param ... Any additional parameters to be passed to the given integration method
#'
#' @return An updated merged SCE object containing a new reduced dimension named
#' `{integration_method}_PCA` containing the corrected PCs. In the case of `fastMNN`
#' `\{integration_method\}_PCA` containing the corrected PCs. In the case of `fastMNN`
#' integration, the SCE also includes a corrected expression assay (`fastMNN_corrected`)
#'
#' @import SingleCellExperiment
Expand Down
6 changes: 3 additions & 3 deletions R/merge_sce_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#' unique cell barcode.
#' - Of the original colData columns, only column names provided in the argument
#' `retain_coldata_cols` will be retained.
#' - The resulting colData row names will be be prefixed with `{sce_name-}`.
#' - The resulting colData row names will be be prefixed with `\{sce_name-\}`.
#' - The resulting rowData slot column names will be appended with the given
#' SCE's name, as `{sce_name}-{column_name}` except for columns whose names
#' SCE's name, as `\{sce_name\}-\{column_name\}` except for columns whose names
#' are indicated to preserve with the `preserve_rowdata_cols` argument.
#'
#' SCE altExp contents are modified or retained as follows:
Expand All @@ -30,7 +30,7 @@
#' the argument `retain_altexp_coldata_cols`, as specified for each named
#' altExp will be retained.
#' - The resulting rowData slot column names will be appended with the given
#' SCE's name, as `{sce_name}-{column_name}` except for columns whose names
#' SCE's name, as `\{sce_name\}-\{column_name\}` except for columns whose names
#' are indicated to preserve with the `preserve_altexp_rowdata_cols` argument.
#'
#'
Expand Down
Empty file modified docker/make-requirements.sh
100644 → 100755
Empty file.
Loading
Loading