Skip to content

Commit

Permalink
Update Battenberg v2.2.9 Dockerfile (#9)
Browse files Browse the repository at this point in the history
* Update Dockerfile for Battenberg 2.2.9  - initial code

* use mamba one-liner to install htslib, allelecount and impute2

* remove redundant codes

* Standardize resource path modification in Dockerfile (applicable for GRCh37 and GRCh38)

* modify resource file paths

* Update README.md

* Update CHANGELOG.md

* Update metadata.yaml

* add reference path modification script

* clean up Dockerfile

* add dependencies tool version

* Update README.md

* change i/o varianble names

* install devtools and its dependencies

* add r-cran-curl

* clean up dockerfile

* Update CHANGELOG.md

* add ASCAT version

* reduce layers

---------

Co-authored-by: Mootor <mmootor@ip-0A125246.rhxrlfvjyzbupc03cc22jkch3c.xx.internal.cloudapp.net>
Co-authored-by: Mootor <mmootor@ip-0A125250.rhxrlfvjyzbupc03cc22jkch3c.xx.internal.cloudapp.net>
  • Loading branch information
3 people authored Jun 27, 2023
1 parent 1febe9d commit ee2a4a0
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]
### Added
- Standardize the `docker-Battenberg` repo
- Add `modify_reference_path.sh`

### Changed
- Update `README.md`
- Update Battenberg `v2.2.9`
- Reconfigure Dockerfile
- Standardize Battenberg resource files
- Standardize the `docker-Battenberg` repo
- Rename `master` to `main` branch

### Removed
Expand Down
56 changes: 55 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
#temp file
ARG MINIFORGE_VERSION=23.1.0-1

FROM condaforge/mambaforge:${MINIFORGE_VERSION} AS builder

# Use mamba to install tools and dependencies into /usr/local
ARG HTSLIB_VERSION=1.16
ARG ALLELECOUNT_VERSION=4.3.0
ARG IMPUTE2_VERSION=2.3.2
RUN mamba create -qy -p /usr/local \
-c bioconda \
-c conda-forge \
htslib==${HTSLIB_VERSION} \
cancerit-allelecount==${ALLELECOUNT_VERSION} \
impute2==${IMPUTE2_VERSION}

# Deploy the target tools into a base image
FROM ubuntu:20.04
COPY --from=builder /usr/local /usr/local

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends libxml2 libxml2-dev libcurl4-gnutls-dev build-essential \
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev r-cran-rgl git libssl-dev r-cran-curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN R -q -e 'install.packages("BiocManager")' && \
R -q -e 'BiocManager::install(c("curl","cpp11","lifecycle","readr","ellipsis","vctrs",\
"GenomicRanges","IRanges","gtools", "optparse", "RColorBrewer","ggplot2",\
"gridExtra","doParallel","foreach", "splines", "VariantAnnotation", "copynumber"))'

# Install devtools, ASCAT & Battenberg
RUN R -q -e 'install.packages("devtools", dependencies = TRUE)' && \
R -q -e 'devtools::install_github("Crick-CancerGenomics/ascat/ASCAT@v3.1.2")' && \
R -q -e 'devtools::install_github("Wedge-Oxford/battenberg@v2.2.9")'

# Modify paths to reference files
COPY modify_reference_path.sh /usr/local/bin/modify_reference_path.sh
RUN chmod +x /usr/local/bin/modify_reference_path.sh && \
bash /usr/local/bin/modify_reference_path.sh /usr/local/lib/R/site-library/Battenberg/example/battenberg_wgs.R /usr/local/bin/battenberg_wgs.R

RUN ln -sf /usr/local/lib/R/site-library/Battenberg/example/filter_sv_brass.R /usr/local/bin/filter_sv_brass.R && \
ln -sf /usr/local/lib/R/site-library/Battenberg/example/battenberg_cleanup.sh /usr/local/bin/battenberg_cleanup.sh

# Add a new user/group called bldocker
RUN groupadd -g 500001 bldocker && \
useradd -r -u 500001 -g bldocker bldocker

# Change the default user to bldocker from root
USER bldocker

LABEL maintainer="Mohammed Faizal Eeman Mootor <MMootor@mednet.ucla.edu>" \
org.opencontainers.image.source=https://github.com/uclahs-cds/docker-Battenberg

CMD ["/bin/bash"]
45 changes: 40 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
# Battenberg
# docker-Battenberg
This repository contains code for the whole genome sequencing subclonal copy number caller Battenberg, as described in [Nik-Zainal, Van Loo, Wedge, et al. (2012), Cell](https://www.ncbi.nlm.nih.gov/pubmed/22608083).

This repository contains a Dockerfile which corresponds to the image found on:
https://hub.docker.com/repository/docker/blcdsdockerregistry/docker-battenberg
It installs the release v2.2.9 of Battenberg and modifies the Battenberg resource paths for GRCh37 and GRCh38 based on how they are structured in the Boutros Lab cluster.

It installs the dev branch of wedge-lab/battenberg, and contains a modified version of
battenberg_wgs.R to allow mounting of the grch38 reference files for battenberg.
This image can be found in docker-Battenberg's GitHub package page [here](https://github.com/uclahs-cds/docker-Battenberg/pkgs/container/battenberg).

# Documentation
Battenberg GitHub repository [here](https://github.com/Wedge-lab/battenberg)


# Version
| Tool | Version |
|------|---------|
|Battenberg|2.2.9|
|HTSlib|1.16|
|alleleCount|4.3.0|
|IMPUTE2|2.3.2|
|ASCAT|3.1.2|


---

## References

1. Nik-Zainal S, Van Loo P, Wedge DC, Alexandrov LB, Greenman CD, Lau KW, Raine K, Jones D, Marshall J, Ramakrishna M, Shlien A, Cooke SL, Hinton J, Menzies A, Stebbings LA, Leroy C, Jia M, Rance R, Mudie LJ, Gamble SJ, Stephens PJ, McLaren S, Tarpey PS, Papaemmanuil E, Davies HR, Varela I, McBride DJ, Bignell GR, Leung K, Butler AP, Teague JW, Martin S, Jönsson G, Mariani O, Boyault S, Miron P, Fatima A, Langerød A, Aparicio SA, Tutt A, Sieuwerts AM, Borg Å, Thomas G, Salomon AV, Richardson AL, Børresen-Dale AL, Futreal PA, Stratton MR, Campbell PJ; Breast Cancer Working Group of the International Cancer Genome Consortium. The life history of 21 breast cancers. Cell. 2012 May 25;149(5):994-1007. doi: 10.1016/j.cell.2012.04.023. Epub 2012 May 17. Erratum in: Cell. 2015 Aug 13;162(4):924. PMID: 22608083; PMCID: PMC3428864.

---

## License

Author: 'Mohammed Faizal Eeman Mootor', 'Ardalan Davarifar'

docker-Battenberg is licensed under the GNU General Public License version 2. See the file LICENSE for the terms of the GNU GPL license.

docker-Battenberg can be used to create a docker instance to use the Battenberg tool.

Copyright (C) 2021-2023 University of California Los Angeles ("Boutros Lab") All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8 changes: 4 additions & 4 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: 'Docker repository for Wedge-lab/battenberg'
maintainers: ['mmootor@mednet.ucla.edu']
languages: ['Dockerfile']
tools: ['battenberg']
version: ['X.X.X'] # Tool version number
purpose: '' # Description of what this tool does
references: '' # is the tool/dependencies published, is there a confluence page
image_name: '' # name of the new docker image
version: ['2.2.9'] # Tool version number
purpose: 'Whole Genome Sequencing subclonal copy number caller' # Description of what this tool does
references: 'https://github.com/Wedge-lab/battenberg' # is the tool/dependencies published, is there a confluence page
image_name: 'battenberg' # name of the new docker image
12 changes: 12 additions & 0 deletions modify_reference_path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/sh

refpath_default=$1
refpath_modified=$2

cat ${refpath_default} | \
sed 's|IMPUTEINFOFILE = \".*|IMPUTEINFOFILE = \"/opt/battenberg_reference/impute_info.txt\"|' | \
sed 's|G1000PREFIX = \".*|G1000PREFIX = \"/opt/battenberg_reference/1000_genomes_loci/1000_genomes_allele_index_chr\"|' | \
sed 's|G1000PREFIX_AC = \".*|G1000PREFIX_AC = \"/opt/battenberg_reference/1000_genomes_loci/1000_genomes_loci_chr\"|' | \
sed 's|GCCORRECTPREFIX = \".*|GCCORRECTPREFIX = \"/opt/battenberg_reference/1000_genomes_gcContent/1000_genomes_GC_corr_chr\"|' | \
sed 's|PROBLEMLOCI = \".*|PROBLEMLOCI = \"/opt/battenberg_reference/battenberg_problem_loci/probloci.txt.gz\"|' | \
sed 's|REPLICCORRECTPREFIX = \".*|REPLICCORRECTPREFIX = \"/opt/battenberg_reference/battenberg_wgs_replication_timing_correction_1000_genomes/1000_genomes_replication_timing_chr\"|' > ${refpath_modified}

0 comments on commit ee2a4a0

Please sign in to comment.