Sign inSign up

albicans2021/rnaseq

By albicans2021

Updated 7 months ago

including FastQC, Trim_galore, STAR, STAR-Fusion, HISAT2, stringtie, samtools, RSEM

Image
0

643

albicans2021/rnaseq repository overview

Security

Tools

The following tools are included:

  • FastQC 0.12.1
  • Trim Galore 0.6.10
  • STAR 2.7.11b
  • STAR-Fusion 1.15.1
  • HISAT2 2.1.0
  • StringTie 2.2.1
  • Samtools 1.17
  • RSEM 1.3.3

Usage

You can run each tool directly by specifying the command after the image name.
Detailed usage and command-line options are not provided here. Please consult the built-in help (--help) or the official documentation for each tool.

docker run --rm albicans2021/rnaseq:tag STAR --help
docker run --rm albicans2021/rnaseq:tag trim_galore --version

docker run --rm albicans2021/rnaseq:tag rsem-rsem-calculate-expression \
                        --num-threads 4 \
                        --alignments \
                        --paired-end \
                        --no-bam-output \
                        --append-names \
                        /path/to/star_result_BAMfile" \
                        "/path/to/RSEM_Reference" \
                        "/path/to/RSEM_result"

change log

v2.5

  • replace base image debian stable-slim to debian trixie-slim for stability
  • replace default-jre package to openjdk-21-jre-headless package, and add libharfbuzz0b fontconfig fonts-dejavu-core packages for FastQC font issue
  • Change the HISAT2 download source to prefer the FTP mirror, as cloud.biohpc may fail due to an expired SSL certificate

v2.4

  • add pigz package for trim_galore

Dockerfile (v2.5)

############################
#       Fetch utils        #
############################
FROM debian:trixie-slim@sha256:f6e2cfac5cf956ea044b4bd75e6397b4372ad88fe00908045e9a0d21712ae3ba AS fetcher
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
      ca-certificates curl unzip tar xz-utils bzip2 \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /opt

############################
#          STAR            #
############################
FROM fetcher AS star_builder
ARG STAR_VERSION=2.7.11b
ARG STAR_URL="https://github.com/alexdobin/STAR/releases/download/${STAR_VERSION}/STAR_${STAR_VERSION}.zip"
# Verified(STAR_2.7.11b.zip)
ARG STAR_SHA256=9ec60251de46c7c83087c06f6a1acab71ad09137d991b485e02be819cb8ad136
RUN set -eux; \
  curl -fsSL -o /tmp/star.zip "${STAR_URL}"; \
  echo "${STAR_SHA256}  /tmp/star.zip" | sha256sum -c -; \
  unzip -q /tmp/star.zip -d /opt; rm -f /tmp/star.zip; \
  STAR_BIN="$(find /opt -type f -name STAR -path '*/Linux_x86_64_static/*' | head -n1)"; \
  test -n "${STAR_BIN}"; \
  install -Dm755 "${STAR_BIN}" /opt/star/STAR

############################
#         HISAT2           #
############################
FROM fetcher AS hisat2_builder
ARG HISAT2_VERSION=2.1.0
# Verified(hisat2-2.1.0-Linux_x86_64.zip)
ARG HISAT2_SHA256=7f68df59db7db93b8a4710d934d75577ac9138ecccc2a8b26d700925354c09bc
# Remove outdated MarkDuplicates.jar (includes vulnerable snappy-java) to avoid CVEs
#ARG HISAT2_URL_PRIMARY="https://cloud.biohpc.swmed.edu/index.php/s/hisat2-210-Linux_x86_64/download"
#ARG HISAT2_URL_FALLBACK="http://ccb.jhu.edu/software/hisat2/dl/hisat2-2.1.0-Linux_x86_64.zip"

ARG HISAT2_URL_PRIMARY="ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/downloads/hisat2-2.1.0-Linux_x86_64.zip"
ARG HISAT2_URL_FALLBACK="https://cloud.biohpc.swmed.edu/index.php/s/hisat2-210-Linux_x86_64/download"

RUN set -eux; \
  tmp=/tmp/hisat2.zip; \
  for u in "${HISAT2_URL_PRIMARY}" "${HISAT2_URL_FALLBACK}"; do \
    echo "Trying $u"; if curl -fL --retry 3 --retry-delay 2 -o "$tmp" "$u"; then break; fi; \
  done; \
  test -s "$tmp"; \
  echo "${HISAT2_SHA256}  $tmp" | sha256sum -c -; \
  unzip -q "$tmp" -d /opt; rm -f "$tmp"; \
  mv /opt/hisat2-* /opt/hisat2

############################
#        StringTie         #
############################
FROM fetcher AS stringtie_builder
ARG ST_VERSION=2.2.1
ARG ST_URL="https://github.com/gpertea/stringtie/releases/download/v${ST_VERSION}/stringtie-${ST_VERSION}.Linux_x86_64.tar.gz"
# Verified SHA256
ARG ST_SHA256=889dd5d573a04a73bb6e0334611982514cbcfa89b1d39dab2eef5134b170af94
RUN set -eux; \
  curl -fsSL -o /tmp/stringtie.tar.gz "${ST_URL}"; \
  echo "${ST_SHA256}  /tmp/stringtie.tar.gz" | sha256sum -c -; \
  mkdir -p /opt/stringtie; \
  tar -xzf /tmp/stringtie.tar.gz -C /opt/stringtie --strip-components=1; \
  rm -f /tmp/stringtie.tar.gz; \
  chmod +x /opt/stringtie/stringtie


############################
#         samtools         #
############################
FROM fetcher AS samtools_builder
ARG SAMTOOLS_VER=1.17
# Verified(samtools-1.17.tar.bz2)
ARG SAMTOOLS_SHA256=3adf390b628219fd6408f14602a4c4aa90e63e18b395dad722ab519438a2a729
RUN apt-get update && apt-get install -y --no-install-recommends \
      build-essential zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev \
  && rm -rf /var/lib/apt/lists/*
RUN set -eux; \
  curl -fsSL -o samtools.tar.bz2 "https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VER}/samtools-${SAMTOOLS_VER}.tar.bz2"; \
  echo "${SAMTOOLS_SHA256}  samtools.tar.bz2" | sha256sum -c -; \
  mkdir -p /opt/samtools-src; \
  tar -xjf samtools.tar.bz2 -C /opt/samtools-src --strip-components=1; rm -f samtools.tar.bz2; \
  cd /opt/samtools-src; \
  ./configure --without-curses; \
  make -j"$(nproc)"; \
  install -Dm755 samtools /opt/samtools/bin/samtools

############################
#       STAR-Fusion        #
############################
FROM fetcher AS starf_builder
ARG SF_VERSION=1.15.1
ARG SF_URL="https://github.com/STAR-Fusion/STAR-Fusion/releases/download/STAR-Fusion-v${SF_VERSION}/STAR-Fusion-v${SF_VERSION}.Full.tar.gz"
# Verified(STAR-Fusion-v1.15.1.Full.tar.gz)
ARG SF_SHA256=3c688c5ca446a3a3171d4f920d7a36fb360d7e49c35425468a3b5feaac0d6187
RUN set -eux; \
  curl -fsSL -o sf.tar.gz "${SF_URL}"; \
  echo "${SF_SHA256}  sf.tar.gz" | sha256sum -c -; \
  mkdir -p /opt; tar -xzf sf.tar.gz -C /opt; rm -f sf.tar.gz; \
  mv "/opt/STAR-Fusion-v${SF_VERSION}" /opt/STAR-Fusion; \
  # Remove outdated MarkDuplicates.jar (includes vulnerable snappy-java) to avoid CVEs
  rm -f /opt/STAR-Fusion/FusionInspector/plugins/MarkDuplicates.jar; \
  chmod +x /opt/STAR-Fusion/STAR-Fusion /opt/STAR-Fusion/FusionInspector/FusionInspector

############################
#          RSEM            #
############################
FROM fetcher AS rsem_builder
ARG RSEM_VERSION=1.3.3
ARG RSEM_URL="https://github.com/deweylab/RSEM/archive/refs/tags/v${RSEM_VERSION}.tar.gz"
# Verified
ARG RSEM_SHA256=90e784dd9df8346caa2a7e3ad2ad07649608a51df1c69bfb6e16f45e611a40dc
RUN apt-get update && apt-get install -y --no-install-recommends \
      build-essential zlib1g-dev libncurses5-dev \
  && rm -rf /var/lib/apt/lists/*
RUN set -eux; \
  curl -fsSL -o rsem.tar.gz "${RSEM_URL}"; \
  echo "${RSEM_SHA256}  rsem.tar.gz" | sha256sum -c -; \
  mkdir -p /opt/rsem-src; \
  tar -xzf rsem.tar.gz -C /opt/rsem-src --strip-components=1; rm -f rsem.tar.gz; \
  make -C /opt/rsem-src; \
  mkdir -p "/opt/RSEM-${RSEM_VERSION}"; \
  cp -a /opt/rsem-src/* "/opt/RSEM-${RSEM_VERSION}/"

############################
#          FastQC          #
############################
FROM fetcher AS fastqc_builder
ARG FASTQC_VERSION=0.12.1
ARG FASTQC_URL="https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v${FASTQC_VERSION}.zip"
# Verified
ARG FASTQC_SHA256=5f4dba8780231a25a6b8e11ab2c238601920c9704caa5458d9de559575d58aa7
RUN set -eux; \
  curl -fsSL -o /tmp/fastqc.zip "${FASTQC_URL}"; \
  echo "${FASTQC_SHA256}  /tmp/fastqc.zip" | sha256sum -c -; \
  unzip -q /tmp/fastqc.zip -d /opt; rm -f /tmp/fastqc.zip; \
  chmod +x /opt/FastQC/fastqc

############################
#       Trim Galore        #
############################
FROM fetcher AS tgalore_builder
ARG TG_VERSION=0.6.10
ARG TG_URL="https://github.com/FelixKrueger/TrimGalore/archive/refs/tags/${TG_VERSION}.tar.gz"
# Verified
ARG TG_SHA256=3a4e414fc658d6eb4356f1572351204e8475a9d7dc79f6798270b57d35bda017
RUN set -eux; \
  curl -fsSL -o tg.tar.gz "${TG_URL}"; \
  echo "${TG_SHA256}  tg.tar.gz" | sha256sum -c -; \
  mkdir -p /opt/TrimGalore; \
  tar -xzf tg.tar.gz -C /opt/TrimGalore --strip-components=1; rm -f tg.tar.gz; \
  install -Dm755 /opt/TrimGalore/trim_galore /opt/trim-galore/bin/trim_galore

############################
#         RUNTIME          #
############################
FROM debian:trixie-slim@sha256:f6e2cfac5cf956ea044b4bd75e6397b4372ad88fe00908045e9a0d21712ae3ba

# Metadata
LABEL maintainer="albicans" \
      org.opencontainers.image.title="albicans2021/rnaseq" \
      org.opencontainers.image.version="2.5" \
      org.opencontainers.image.description="FastQC, Trim Galore, HISAT2, samtools, STAR, STAR-Fusion, RSEM on Debian trixie-slim" \
      org.opencontainers.image.source="(see individual upstreams)"

# Set timezone via ENV only (tzdata not installed)
ENV TZ=Asia/Tokyo

# Minimal runtime dependencies (optimized for Docker Scout score)
# - Perl: required by STAR-Fusion
# - python3-venv: install Cutadapt for Trim Galore in a virtual environment
# - Bio-related libs: zlib/bzip2/lzma/curl for samtools support
# - bedtools/gffread/tabix: required by STAR-Fusion
# v2.4 - added pigz
# v2.5 - replace default-jre package to openjdk-21-jre-headless package, and add libharfbuzz0b fontconfig fonts-dejavu-core packages for FastQC font issue
#      - replace base image debian stable-slim to debian trixie-slim for stability
RUN apt-get update && apt-get upgrade -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
      perl liburi-perl libjson-xs-perl libset-intervaltree-perl \
      python3 python3-venv \
      openjdk-21-jre-headless \
      libharfbuzz0b fontconfig fonts-dejavu-core \
      zlib1g libbz2-1.0 liblzma5 libcurl4 libgomp1 \
      bedtools gffread tabix \
      pigz \
      bash coreutils ca-certificates less \
  && rm -rf /var/lib/apt/lists/*

# ---- Python venv: dependency for Trim Galore (cutadapt) ----
RUN python3 -m venv /opt/venv \
 && /opt/venv/bin/pip install --upgrade pip setuptools wheel \
 && /opt/venv/bin/pip install --no-cache-dir "cutadapt>=4" \
 && { [ -e /opt/venv/bin/python ] || ln -s python3 /opt/venv/bin/python; }
RUN ln -sf /opt/venv/bin/python /usr/local/bin/python
ENV PATH="/opt/venv/bin:/usr/local/bin:${PATH}"

# ---- Install tools ----
# STAR
COPY --from=star_builder /opt/star/STAR /usr/local/bin/STAR

# HISAT2 (link all executables)
COPY --from=hisat2_builder /opt/hisat2 /opt/hisat2
RUN set -eux; \
  chmod +x /opt/hisat2/hisat2 /opt/hisat2/hisat2-* /opt/hisat2/*.py; \
  ln -sf /opt/hisat2/hisat2 /usr/local/bin/hisat2; \
  for f in /opt/hisat2/hisat2-*; do ln -sf "$f" "/usr/local/bin/$(basename "$f")"; done

# samtools
COPY --from=samtools_builder /opt/samtools/bin/samtools /usr/local/bin/samtools

# STAR-Fusion
ENV STARFUSION_HOME=/opt/STAR-Fusion
COPY --from=starf_builder /opt/STAR-Fusion ${STARFUSION_HOME}
RUN set -eux; \
  chmod +x ${STARFUSION_HOME}/STAR-Fusion ${STARFUSION_HOME}/FusionInspector/FusionInspector; \
  ln -sf ${STARFUSION_HOME}/STAR-Fusion /usr/local/bin/STAR-Fusion; \
  ln -sf ${STARFUSION_HOME}/FusionInspector/FusionInspector /usr/local/bin/FusionInspector
ENV PERL5LIB="${STARFUSION_HOME}/PerlLib:${STARFUSION_HOME}/FusionInspector:${STARFUSION_HOME}/FusionInspector/PerlLib"
ENV PATH="/usr/local/bin:${STARFUSION_HOME}:${PATH}"

# StringTie
COPY --from=stringtie_builder /opt/stringtie/stringtie /usr/local/bin/stringtie

# RSEM
ARG RSEM_VERSION=1.3.3
ENV RSEM_DIR=/opt/RSEM-${RSEM_VERSION}
COPY --from=rsem_builder ${RSEM_DIR} ${RSEM_DIR}
ENV PATH="${RSEM_DIR}:${PATH}"

# FastQC
COPY --from=fastqc_builder /opt/FastQC /opt/FastQC
RUN ln -sf /opt/FastQC/fastqc /usr/local/bin/fastqc

# Trim Galore
COPY --from=tgalore_builder /opt/trim-galore/bin/trim_galore /usr/local/bin/trim_galore

# ---- Non-root user ----
RUN groupadd -g 1000 main && useradd -m -s /bin/bash -u 1000 -g 1000 main
USER main
WORKDIR /home/main

# Default command (optional): show environment summary
CMD ["/bin/bash", "-lc", "echo 'Tools:'; for c in fastqc trim_galore hisat2 samtools STAR STAR-Fusion FusionInspector rsem-calculate-expression; do command -v $c || true; done; echo 'Python:'; python --version; echo 'Done.'"]

Tag summary

Content type

Image

Digest

sha256:2bfadf1bd

Size

245.8 MB

Last updated

7 months ago

docker pull albicans2021/rnaseq:2.5