diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..88bfc892 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Use Mambaforge as base - it's optimized for conda-forge and bioconda +FROM condaforge/mambaforge:latest + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + build-essential \ + git \ + wget \ + unzip \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get autoremove -y \ + && apt-get clean + +# Prevent conda from activating the base environment +ENV CONDA_AUTO_ACTIVATE_BASE=false + +# Install DROP using mamba +# Combining commands to reduce layers and cleanup to reduce image size +RUN mamba create -n drop_env -c conda-forge -c bioconda drop \ + bioconda::bioconductor-bsgenome.hsapiens.ucsc.hg38 \ + bioconda::bioconductor-bsgenome.hsapiens.ucsc.hg19 \ + --override-channels -y && \ + mamba clean -afy && \ + find /opt/conda/ -follow -type f -name '*.a' -delete && \ + find /opt/conda/ -follow -type f -name '*.pyc' -delete && \ + find /opt/conda/ -follow -type f -name '*.js.map' -delete + +# Set up the environment activation script +RUN echo '. /opt/conda/etc/profile.d/conda.sh && conda activate drop_env' >> /.bashrc && \ + echo '. /opt/conda/etc/profile.d/conda.sh && conda activate drop_env' >> /.profile + +# Make sure the conda environment is activated for any command +ENV PATH /opt/conda/envs/drop_env/bin:$PATH diff --git a/container_info.md b/container_info.md new file mode 100644 index 00000000..89e33860 --- /dev/null +++ b/container_info.md @@ -0,0 +1,23 @@ +# Using the containerised version of DROP +The prebuilt container is available here: https://quay.io/repository/sarahbeecroft9/drop + +In the example, let's use the Singularity container engine. + +Getting the container from the repo onto your machine: +`singularity pull docker pull quay.io/sarahbeecroft9/drop` +This will create a file called drop_latest.sif + +## some examples +Here, the my_drop_analysis_dir is the directory you wish to read/write your drop results into/out of. You can also specify the full path as opposed to the relative path used in these examples. It is important to use the `-B my_drop_analysis_dir:/home/ubuntu` flag, which will bind-mount your local analysis directory to the home directory in the container. + +### Example 1A: Run `drop demo` in `my_drop_analysis_dir` +`singularity exec -B my_drop_analysis_dir:/home/ubuntu drop.sif drop demo` + +### Example 1B: Run snakemake pipeline in `my_drop_analysis_dir` +`singularity exec -B my_drop_analysis_dir:/home/ubuntu drop.sif snakemake -c 10` + +### Example 2A: Run `drop init` in `my_drop_analysis_dir` +`singularity exec -B my_drop_analysis_dir:/home/ubuntu drop.sif drop init` + +### Example 2B: Run snakemake pipeline in `my_drop_analysis_dir` +`singularity exec -B my_drop_analysis_dir:/home/ubuntu drop.sif snakemake -c 10`