-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1111 from taylorpaisie/tkp-hostile
Adding hostile v1.1.0
- Loading branch information
Showing
6 changed files
with
117 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Set global variables | ||
ARG HOSTILE_VER="1.1.0" | ||
ARG BOWTIE2_VER="2.5.1" | ||
|
||
# Stage 1: Build Dockerfile | ||
FROM ubuntu:focal AS builder | ||
ARG HOSTILE_VER | ||
ARG BOWTIE2_VER | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
python3.10 python3.10-distutils build-essential \ | ||
wget unzip samtools minimap2 bedtools gawk ca-certificates && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install pip for Python 3.10 | ||
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.10 get-pip.py && \ | ||
rm get-pip.py && pip install --no-cache-dir setuptools pytest && \ | ||
ln -sf /usr/bin/python3.10 /usr/bin/python3 && \ | ||
ln -sf /usr/local/bin/pip /usr/bin/pip | ||
|
||
# Install bowtie2 and ensure all executables are accessible | ||
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v${BOWTIE2_VER}/bowtie2-${BOWTIE2_VER}-linux-x86_64.zip && \ | ||
unzip bowtie2-${BOWTIE2_VER}-linux-x86_64.zip && \ | ||
mv bowtie2-${BOWTIE2_VER}-linux-x86_64 /usr/local/bowtie2 && \ | ||
ln -s /usr/local/bowtie2/bowtie2* /usr/bin/ && \ | ||
rm -f bowtie2-${BOWTIE2_VER}-linux-x86_64.zip | ||
|
||
# Install hostile | ||
RUN wget https://github.com/bede/hostile/archive/refs/tags/${HOSTILE_VER}.tar.gz && \ | ||
tar -xzvf ${HOSTILE_VER}.tar.gz && cd hostile-${HOSTILE_VER} && \ | ||
pip install --no-cache-dir . && \ | ||
pytest && \ | ||
cd .. && rm -rf ${HOSTILE_VER}.tar.gz | ||
|
||
|
||
# Stage 2: Final image | ||
FROM ubuntu:focal AS app | ||
ARG HOSTILE_VER | ||
|
||
LABEL base.image="ubuntu:focal" | ||
LABEL dockerfile.version="1" | ||
LABEL software="hostile" | ||
LABEL software.version=${HOSTILE_VER} | ||
LABEL description="Precise host read removal." | ||
LABEL website="https://github.com/bede/hostile" | ||
LABEL license.url="https://github.com/bede/hostile?tab=MIT-1-ov-file#readme" | ||
LABEL maintainer="Taylor K. Paisie" | ||
LABEL maintainer.email="[email protected]" | ||
|
||
COPY --from=builder /usr/ /usr/ | ||
COPY --from=builder /hostile-${HOSTILE_VER}/tests/data/sars-cov-2/ /data/test/sars-cov-2/ | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates && update-ca-certificates && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
CMD hostile --help | ||
WORKDIR /data | ||
|
||
# Optional stage: Test data | ||
FROM app AS test | ||
|
||
WORKDIR /data/test | ||
|
||
RUN wget https://github.com/bacterial-genomics/test-datasets/raw/assembly/test_data/test_miniburk_R1.fastq.gz \ | ||
--no-check-certificate && \ | ||
wget https://github.com/bacterial-genomics/test-datasets/raw/assembly/test_data/test_miniburk_R2.fastq.gz \ | ||
--no-check-certificate && \ | ||
hostile clean --index /data/test/sars-cov-2/sars-cov-2 --fastq1 test_miniburk_R1.fastq.gz --fastq2 test_miniburk_R2.fastq.gz | ||
|
||
WORKDIR /data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# hostile | ||
|
||
Main tool: [hostile](https://github.com/bede/hostile) | ||
|
||
Code repository: https://github.com/bede/hostile | ||
|
||
Basic information on how to use this tool: | ||
- executable: | | ||
``` | ||
usage: hostile [-h] [--version] {clean,mask,fetch} ... | ||
positional arguments: | ||
{clean,mask,fetch} | ||
clean Remove reads aligning to an index from fastq[.gz] input files | ||
mask Mask reference genome against target genome(s) | ||
fetch Download and cache indexes from object storage for use with hostile clean | ||
options: | ||
-h, --help show this help message and exit | ||
--version show program's version number and exit | ||
``` | ||
|
||
- help: `hostile --help` | ||
- version: `hostle --version` | ||
- description: | | ||
> Hostile accurately removes host sequences from short and long read (meta)genomes, consuming single-read or paired fastq input. | ||
|
||
Full documentation: https://github.com/bede/hostile | ||
|
||
|
||
# Testing hostile analysis | ||
``` | ||
# Downloading test dataset | ||
wget https://github.com/bacterial-genomics/test-datasets/raw/assembly/test_data/test_miniburk_R1.fastq.gz --no-check-certificate | ||
wget https://github.com/bacterial-genomics/test-datasets/raw/assembly/test_data/test_miniburk_R2.fastq.gz --no-check-certificate | ||
# Running hostile clean on test dataset | ||
hostile clean --index /data/test/sars-cov-2/sars-cov-2 --fastq1 test_miniburk_R1.fastq.gz --fastq2 test_miniburk_R2.fastq.gz | ||
``` |