Skip to content

Commit

Permalink
Merge pull request #11 from umccr/docker_update
Browse files Browse the repository at this point in the history
Update CHORD and mutSigExtractor
  • Loading branch information
pdiakumis authored Dec 17, 2024
2 parents 49cb0ca + dce1943 commit d022ed2
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 5,448 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.1.2.5"
current_version = "0.1.2.7"
search = "{current_version}"
replace = "{new_version}"
message = "Bump version: {current_version} → {new_version}"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ on:
push:
branches:
- main
- gha-test
env:
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
recipe_path: conda/recipe
env_yaml_path: conda/env/yaml
env_lock_path: conda/env/lock
VERSION: '0.1.2.5' # versioned by bump2version
VERSION: '0.1.2.7' # versioned by bump2version
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}

jobs:
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sigrap
Title: Wrappers for somatic mutation signature analysis tools
Version: 0.1.2.5
Version: 0.1.2.7
Description: Wraps functionality from somatic signature analysis tools.
Authors@R:
person(given = "Peter",
Expand Down Expand Up @@ -33,6 +33,7 @@ Imports:
tidyr,
VariantAnnotation
Suggests:
argparse,
BSgenome.Hsapiens.UCSC.hg19,
BSgenome.Hsapiens.UCSC.hg38,
BSgenome.Hsapiens.1000genomes.hs37d5,
Expand Down
56 changes: 32 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
FROM ubuntu:20.04
LABEL maintainer="https://github.com/pdiakumis"
ARG MINIF="miniforge"
ARG MINIF_VERSION="24.11.0-1"
ARG MINIF_URL="https://github.com/conda-forge/${MINIF}/releases/download/${MINIF_VERSION}/Miniforge3-${MINIF_VERSION}-Linux-x86_64.sh"

ARG MINI_VERSION=4.12.0-0
ARG MINI_URL=https://github.com/conda-forge/miniforge/releases/download/${MINI_VERSION}/Mambaforge-${MINI_VERSION}-Linux-x86_64.sh
ARG MAMBA_PREFIX="/opt/mambaforge"

# install core pkgs, mambaforge
RUN apt-get update -qq && \
apt-get install --yes --no-install-recommends -qq \
git bash bzip2 curl ca-certificates && \
# install core pkgs, miniforge
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
bash bzip2 curl less wget zip ca-certificates && \
apt-get clean && \
rm -r /var/lib/apt/lists/* && \
rm -r /var/cache/apt/* && \
curl --silent -L "${MINI_URL}" -o "mambaforge.sh" && \
/bin/bash mambaforge.sh -b -p "${MAMBA_PREFIX}" && \
rm mambaforge.sh
curl --silent -L "${MINIF_URL}" -o "${MINIF}.sh" && \
/bin/bash "${MINIF}.sh" -b -p "/opt/${MINIF}/" && \
rm "${MINIF}.sh"

# create conda env
ENV PATH="${MAMBA_PREFIX}/bin:$PATH"
ARG ENV_DIR=/home/sigrap_conda_env
ARG ENV_NAME="sigrap_env"
COPY ./conda/env/lock ${ENV_DIR}
RUN conda config --set always_yes yes && \
mamba install -c conda-forge conda-lock==1.0.5
RUN conda-lock install --name ${ENV_NAME} ${ENV_DIR}/conda-lock.yml && \
mamba clean --all --force-pkgs-dirs
ENV PATH="/opt/${MINIF}/bin:$PATH"
ARG CONDA_ENV_DIR="/home/conda_envs"
ARG PKG_LOCK="sigrap-linux-64.lock"
COPY "./conda/env/lock/${PKG_LOCK}" "${CONDA_ENV_DIR}/"
RUN conda create -n "sigrap_env" --file "${CONDA_ENV_DIR}/${PKG_LOCK}"
RUN conda clean --all --force-pkgs-dirs --yes

# Now copy env to smaller image
FROM quay.io/bioconda/base-glibc-debian-bash:3.1
LABEL org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.description="Wrappers for somatic mutation signature analysis tools" \
org.opencontainers.image.source="https://github.com/umccr/sigrap" \
org.opencontainers.image.url="https://github.com/umccr/sigrap" \
org.opencontainers.image.documentation="https://umccr.github.io/sigrap" \
org.opencontainers.image.licenses="MIT"

COPY --from=0 "/opt/miniforge/envs/" "/opt/miniforge/envs/"

ENV PATH="${MAMBA_PREFIX}/envs/${ENV_NAME}/bin:${PATH}"
ENV CONDA_PREFIX="${MAMBA_PREFIX}/envs/${ENV_NAME}"
# env is activated by default
ARG MINIF="miniforge"
ARG CONDA_ENV_NAME="sigrap_env"
ENV PATH="/opt/${MINIF}/envs/${CONDA_ENV_NAME}/bin:${PATH}"
ENV CONDA_PREFIX="/opt/${MINIF}/envs/${CONDA_ENV_NAME}"

CMD [ "sigrap.R" ]
2 changes: 1 addition & 1 deletion R/chord.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ chord_run <- function(vcf.snv = NULL, vcf.sv = NULL, df.sv = NULL,
do.bootstrap = TRUE, verbose = FALSE
) |>
dplyr::mutate(
dplyr::across(tidyselect::vars_select_helpers$where(is.numeric), round, 3)
dplyr::across(dplyr::where(is.numeric), \(x) round(x, 3))
)

# custom order of prediction cols
Expand Down
6 changes: 6 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ pkg_exists <- function(p) {
assertthat::assert_that(is.character(p))
nzchar(system.file(package = p))
}

#' @noRd
dummy1 <- function() {
# Solves R CMD check: Namespaces in Imports field not imported from
argparse::ArgumentParser
}
Loading

0 comments on commit d022ed2

Please sign in to comment.