Skip to content

Commit 9d5edc2

Browse files
feat: create ichorcna docker (#321)
* feat: create ichorcna docker * feat: add test file for ichorcna docker * docs: 🤖 update readme for ichorCNA/ccbr_ichorcna_0.3.2/Dockerfile.v1 (#322) Co-authored-by: 41898282+github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0b080c0 commit 9d5edc2

4 files changed

Lines changed: 194 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM nciccbr/ccbr_ubuntu_base_20.04:v7
2+
3+
ARG BUILD_DATE="000000"
4+
ENV BUILD_DATE=${BUILD_DATE}
5+
ARG BUILD_TAG="000000"
6+
ENV BUILD_TAG=${BUILD_TAG}
7+
ARG REPONAME="000000"
8+
ENV REPONAME=${REPONAME}
9+
ARG DOCKERFILE="Dockerfile"
10+
ENV DOCKERFILE=${DOCKERFILE}
11+
12+
COPY environment.yml /data2/
13+
ENV CONDA_ENV=ichorcna
14+
RUN mamba env create -n ${CONDA_ENV} -f /data2/environment.yml && \
15+
/opt2/conda/bin/conda init bash && \
16+
echo "conda activate ${CONDA_ENV}" >> ~/.bashrc && \
17+
chmod -R a+rx /opt2
18+
19+
ENV PATH="/opt2/conda/envs/${CONDA_ENV}/bin:/opt2/conda/bin:$PATH"
20+
21+
# Install HMMcopy utilities
22+
RUN cd /data2 && \
23+
git clone https://github.com/shahcompbio/hmmcopy_utils.git && \
24+
cd hmmcopy_utils && \
25+
cmake . && \
26+
make && \
27+
cp bin/* /opt2/conda/envs/${CONDA_ENV}/bin/
28+
29+
# Clone ichorCNA v0.3.2 for scripts
30+
RUN cd /data2 && \
31+
git clone https://github.com/broadinstitute/ichorCNA.git && \
32+
ln -s /data2/ichorCNA/scripts /opt2/conda/envs/${CONDA_ENV}/lib/R/library/ichorCNA/scripts
33+
34+
# Copy and run test
35+
COPY test_ichorcna.sh /data2/
36+
RUN chmod +x /data2/test_ichorcna.sh && \
37+
/bin/bash -c "source activate ${CONDA_ENV} && /data2/test_ichorcna.sh"
38+
39+
COPY ${DOCKERFILE} /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
40+
41+
WORKDIR /data2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ichorcna
2+
channels:
3+
- bioconda
4+
- conda-forge
5+
- defaults
6+
dependencies:
7+
- python=3.9
8+
- seqtk=1.5
9+
- fastp=0.24.0
10+
- r-base=4.2
11+
- r-devtools=2.4.5
12+
- r-plyr=1.8.9
13+
- r-stringi
14+
- icu=70
15+
- bioconductor-hmmcopy
16+
- bioconductor-genomeinfodb
17+
- bioconductor-genomicranges
18+
- r-ichorcna=0.3.2
19+
- cmake=3.26
20+
- make
21+
- cxx-compiler
22+
- pip=25.1.1
23+
- pip:
24+
- atari==0.1.4
25+
- igv-reports==1.16.1
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Testing ichorCNA v0.3.2 installation..."
5+
6+
# Create test directories
7+
mkdir -p /data2/ichorcna_test/output
8+
9+
# Set ichorCNA path (should be set by Dockerfile, but fallback if needed)
10+
if [ -z "${ICHORCNA_PATH}" ]; then
11+
ICHORCNA_PATH="/data2/ichorCNA"
12+
fi
13+
14+
echo "Using ichorCNA at: ${ICHORCNA_PATH}"
15+
16+
# Test 1: Verify readCounter exists (from HMMcopy)
17+
echo "Testing readCounter..."
18+
readCounter --help > /dev/null 2>&1 || echo "Warning: readCounter not found (optional)"
19+
20+
# Test 2: Verify ichorCNA R package loads and check version
21+
echo "Testing ichorCNA R package..."
22+
Rscript -e "library(ichorCNA); v <- packageVersion('ichorCNA'); cat('ichorCNA version:', as.character(v), '\n'); stopifnot(as.character(v) == '0.3.2')"
23+
24+
# Test 3: Check required script exists
25+
echo "Checking runIchorCNA.R script..."
26+
if [ ! -f "${ICHORCNA_PATH}/scripts/runIchorCNA.R" ]; then
27+
echo "ERROR: runIchorCNA.R script not found"
28+
exit 1
29+
fi
30+
31+
# Test 4: Check required extdata files exist (hg19 for test data)
32+
echo "Checking extdata files..."
33+
ls -lh ${ICHORCNA_PATH}/inst/extdata/gc_hg19_1000kb.wig
34+
ls -lh ${ICHORCNA_PATH}/inst/extdata/map_hg19_1000kb.wig
35+
ls -lh ${ICHORCNA_PATH}/inst/extdata/MBC_315.ctDNA.reads.wig
36+
37+
# Test 5: Run ichorCNA on test data (using hg19 references to match test data)
38+
echo "Running ichorCNA on test sample..."
39+
Rscript ${ICHORCNA_PATH}/scripts/runIchorCNA.R \
40+
--libdir "${ICHORCNA_PATH}" \
41+
--id test_sample \
42+
--WIG ${ICHORCNA_PATH}/inst/extdata/MBC_315.ctDNA.reads.wig \
43+
--gcWig ${ICHORCNA_PATH}/inst/extdata/gc_hg19_1000kb.wig \
44+
--mapWig ${ICHORCNA_PATH}/inst/extdata/map_hg19_1000kb.wig \
45+
--ploidy "c(2,3)" \
46+
--normal "c(0.5,0.6,0.7,0.8,0.9)" \
47+
--maxCN 5 \
48+
--includeHOMD False \
49+
--chrs "c(1:22, \"X\")" \
50+
--chrTrain "c(1:22)" \
51+
--estimateNormal True \
52+
--estimatePloidy True \
53+
--estimateScPrevalence False \
54+
--txnE 0.9999 \
55+
--txnStrength 10000 \
56+
--outDir /data2/ichorcna_test/output
57+
58+
# Test 6: Verify output files were created
59+
echo "Verifying output files..."
60+
if [ ! -f "/data2/ichorcna_test/output/test_sample.cna.seg" ]; then
61+
echo "ERROR: Expected output file test_sample.cna.seg not created"
62+
exit 1
63+
fi
64+
65+
if [ ! -f "/data2/ichorcna_test/output/test_sample.seg.txt" ]; then
66+
echo "ERROR: Expected output file test_sample.seg.txt not created"
67+
exit 1
68+
fi
69+
70+
# Test 7: Check output contains data
71+
SEG_LINES=$(wc -l < /data2/ichorcna_test/output/test_sample.seg.txt)
72+
if [ ${SEG_LINES} -lt 2 ]; then
73+
echo "ERROR: Output segmentation file is empty or too small"
74+
exit 1
75+
fi
76+
77+
echo "✓ All ichorCNA v0.3.2 tests passed!"
78+
echo ""
79+
echo "Output files:"
80+
ls -lh /data2/ichorcna_test/output/
81+
82+
# Clean up test directory
83+
rm -rf /data2/ichorcna_test
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## CCBR/Dockers2 nciccbr/ccbr_ichorcna_0.3.2:v1-dev
2+
3+
Dockerfile source: https://github.com/CCBR/Dockers2/blob/a0ac517d963fbeddfb01c810fbd06d9365c02f22/ichorCNA/ccbr_ichorcna_0.3.2/Dockerfile.v1
4+
5+
6+
Built on: 2025-11-11_19:09:31
7+
8+
Build tag: v1-dev
9+
10+
Base image: nciccbr/ccbr_ubuntu_base_20.04:v7
11+
12+
Dockerfile path in repo: ichorCNA/ccbr_ichorcna_0.3.2/Dockerfile.v1
13+
14+
15+
| Tool | Version |
16+
|---------|---------|
17+
| bbtools | NOTINDOCKER |
18+
| bcftools | 1.10.2 using htslib 1.10.2-3ubuntu0.1 |
19+
| bedops | 2.4.37 typical |
20+
| bedtools | v2.27.1 |
21+
| bowtie | 1.2.3 |
22+
| bowtie2 | 2.3.5.1 |
23+
| bwa | 0.7.17-r1188 |
24+
| cutadapt | NOTINDOCKER |
25+
| fastqc | NOTINDOCKER |
26+
| fastQValidator | NOTINDOCKER |
27+
| fastqscreen | NOTINDOCKER |
28+
| git | 2.25.1 |
29+
| java | 1.8.0_422 |
30+
| kraken2 | NOTINDOCKER |
31+
| kronatools | NOTINDOCKER |
32+
| multiqc | NOTINDOCKER |
33+
| parallel | 20161222 |
34+
| picard | NOTINDOCKER |
35+
| pigz | 2.4 |
36+
| preseq | NOTINDOCKER |
37+
| python2 | 2.7.18 |
38+
| python3 | 3.9.23 |
39+
| qualimap | NOTINDOCKER |
40+
| rsem | NOTINDOCKER |
41+
| rseqc | NOTINDOCKER |
42+
| samtools | 1.10 |
43+
| ucsc_tools | NOTINDOCKER |
44+
| vcftools | 0.1.16 |
45+

0 commit comments

Comments
 (0)