Skip to content

Commit

Permalink
Merge pull request #398 from lilab-bcb/upgrade-cellbender
Browse files Browse the repository at this point in the history
Upgrade cellbender to 0.3.0
  • Loading branch information
yihming authored Jan 26, 2024
2 parents 1f1d438 + dc1e424 commit c07df2a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
50 changes: 50 additions & 0 deletions docker/cellbender/0.3.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Start from nvidia-docker image with drivers pre-installed to use a GPU
FROM nvcr.io/nvidia/cuda:11.7.1-base-ubuntu22.04

LABEL description="This docker is modified from the official BSD-3-Clause licensed CellBender dockerfile (https://github.com/broadinstitute/CellBender/blob/master/docker/Dockerfile)."

# Install curl and sudo and git and miniconda and pytorch, cudatoolkit, pytables, and cellbender
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
wget \
rsync \
ca-certificates \
unzip

RUN curl -so miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_23.1.0-1-Linux-x86_64.sh && \
bash miniconda.sh -b -p /opt/miniconda3 && \
rm miniconda.sh

ENV PATH=/opt/miniconda3/bin:$PATH \
DOCKER=true \
CONDA_AUTO_UPDATE_CONDA=false

RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && apt-get install -y google-cloud-cli

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.15.10.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm awscliv2.zip

RUN pip install stratocumulus==0.2.1

RUN wget https://github.com/broadinstitute/CellBender/archive/refs/tags/v0.3.0.tar.gz && \
tar -xzf v0.3.0.tar.gz && \
rm v0.3.0.tar.gz && \
mkdir /software && \
mv CellBender-0.3.0 /software/CellBender && \
cd /software/CellBender && \
pip install -e .

RUN apt-get -qq -y autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/log/dpkg.log

ADD https://raw.githubusercontent.com/lilab-bcb/cumulus/master/docker/monitor_script.sh /software
RUN chmod a+rx /software/monitor_script.sh

# Add cellbender command to PATH
ENV PATH=/software:$PATH
16 changes: 9 additions & 7 deletions docs/cellbender.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ Below are inputs for *CellBender* workflow. Notice that required inputs are **in
- "gs://fc-e0000000-0000-0000-0000-000000000000/my-project/cellbender_output"
-
* - expected_cells
- Number of cells expected in the dataset (a rough estimate within a factor of 2 is sufficient).
- | Number of cells expected in the dataset (a rough estimate within a factor of 2 is sufficient).
| **Notice:** If *cellbender_version* is ``0.3.0``, no need to specify this parameter.
- 2048
- ``None``
- Automatically inferred from data
* - total_droplets_included
- The number of droplets from the rank-ordered UMI plot that will be analyzed. The largest *total_droplets_included* droplets will have their cell probabilities inferred as an output.
- 25000
- | The number of droplets from the rank-ordered UMI plot that will be analyzed. The largest *total_droplets_included* droplets will have their cell probabilities inferred as an output.
| **Notice:** If *cellbender_version* is ``0.3.0``, no need to specify this parameter.
- 25000
- Automatically inferred from data
* - model
- Which model is being used for count data:

Expand Down Expand Up @@ -127,9 +129,9 @@ Below are inputs for *CellBender* workflow. Notice that required inputs are **in
- "quay.io/cumulus"
- "quay.io/cumulus"
* - cellbender_version
- CellBender version to use. Currently available: ``0.2.0``.
- "0.2.0"
- "0.2.0"
- CellBender version to use. Currently available: ``0.3.0``, ``0.2.0``.
- "0.3.0"
- "0.3.0"
* - zones
- Google cloud zones to consider for execution. Only works if *backend* is ``gcp``.
- "us-east1-d us-west1-a us-west1-b"
Expand Down
6 changes: 3 additions & 3 deletions workflows/cellbender/cellbender.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ workflow cellbender {
String output_directory
# Docker image for cellbender remove-background version
String docker_registry = "quay.io/cumulus"
# Cellbender version to use. Currently support: 0.2.0
String cellbender_version = "0.2.0"
# Cellbender version to use. Currently support: 0.3.0, 0.2.0
String cellbender_version = "0.3.0"

# Expected cells
Int? expected_cells
Expand Down Expand Up @@ -156,7 +156,7 @@ task run_cellbender_remove_background_gpu {
~{"--learning-rate " + learning_rate} \
~{true="--exclude-antibody-capture" false=" " exclude_antibody_capture}

strato cp --backend ~{backend} ~{sample_name}_out* ~{output_directory}/~{sample_name}/
strato cp ~{sample_name}_out* ~{output_directory}/~{sample_name}/
}

output {
Expand Down

0 comments on commit c07df2a

Please sign in to comment.