# HG changeset patch # User galaxytrakr # Date 1789163923 0 # Node ID adc887a1a6deae0fbe488024e3f17da4517c738b planemo upload commit 927c4ee71df7d19ceb10446a04618af22c99d839 diff -r 000000000000 -r adc887a1a6de Dockerfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile Fri Sep 11 21:58:43 2026 +0000 @@ -0,0 +1,91 @@ +# ============================================================= +# Dockerfile for mitokmer2 (compatible with Galaxy/AWS Batch) +# ============================================================= + +# ---------- Build Stage ---------- +FROM ubuntu:focal AS build + +ARG DEBIAN_FRONTEND=noninteractive +ARG PYTHON_VER="3.8" + +WORKDIR /workspace + +# Build dependencies: compiler, zlib dev headers, git, Python +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + g++ \ + git \ + wget \ + zlib1g-dev \ + ca-certificates \ + python${PYTHON_VER} \ + python${PYTHON_VER}-dev \ + python${PYTHON_VER}-venv \ + && rm -rf /var/lib/apt/lists/* + +# Create Python virtual environment using --copies so symlinks +# do not break when the venv is copied to the runtime stage +RUN python${PYTHON_VER} -m venv --copies /opt/venv +ENV PATH="/opt/venv/bin:${PATH}" + +# Install Python dependencies +RUN pip install --no-cache-dir -U pip && \ + pip install --no-cache-dir pandas + +# Clone mitokmer2 source code from GitHub +RUN git clone https://github.com/mmammel8/mitokmer2.git /opt/mitokmer2 + +WORKDIR /opt/mitokmer2 + +# Compile the C++ read-screening program +# kmer_read_1.cpp -> kmerread +RUN g++ -O3 kmer_read_1.cpp -o kmerread -lz && \ + chmod +x kmerread + +# Install any Python requirements declared in the repo +RUN if [ -f requirements.txt ]; then \ + pip install --no-cache-dir -r requirements.txt; \ + fi + + +# ---------- Runtime Stage ---------- +FROM ubuntu:focal AS runtime + +ARG DEBIAN_FRONTEND=noninteractive + +# Lean runtime: zlib shared library + Python runtime only +RUN apt-get update && apt-get install -y --no-install-recommends \ + zlib1g \ + libbz2-1.0 \ + ca-certificates \ + python3.8 \ + python3.8-venv \ + python3.8-distutils \ + && rm -rf /var/lib/apt/lists/* + +# Copy compiled binary from build stage +COPY --from=build /opt/mitokmer2/kmerread /usr/local/bin/kmerread + +# Copy Python scripts and supporting files from build stage +COPY --from=build /opt/mitokmer2 /opt/mitokmer2 + +# Copy Python virtual environment from build stage +# --copies in the build stage ensures no broken symlinks here +COPY --from=build /opt/venv /opt/venv + +# Refresh the dynamic linker cache so zlib and other shared +# libraries are found at runtime +RUN ldconfig || true + +# Ensure all users (including arbitrary Galaxy UIDs) can +# read and execute binaries, scripts, and the venv +RUN chmod a+rx /usr/local/bin/kmerread && \ + chmod -R a+rX /opt/mitokmer2 && \ + chmod -R a+rX /opt/venv + +# Runtime environment +ENV PATH="/opt/venv/bin:/opt/mitokmer2:/usr/local/bin:${PATH}" \ + LC_ALL=C + +# IMPORTANT: No ENTRYPOINT for Galaxy/AWS Batch. Neutral CMD. +CMD ["/bin/bash"] diff -r 000000000000 -r adc887a1a6de mitokmer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mitokmer.xml Fri Sep 11 21:58:43 2026 +0000 @@ -0,0 +1,151 @@ + + Identify metagenomic mitochondrial reads by k-mer database matching + + quay.io/galaxytrakr/mitokmer2:latest + + + + ## Lines 2+: absolute path to each read file, one per line + #set sample_name = $reads[0].element_identifier.replace(' ', '_').split('_')[:-1] | join('_') + echo "${sample_name} ${reads|length}" > ./jobs1/jobs1.txt && + #for read in $reads + echo "\$PWD/reads/${read.element_identifier.replace(' ', '_')}" >> ./jobs1/jobs1.txt && + #end for + + ## ── Run kmerread (reads jobs1/jobs1.txt and mitoch/mitoch_probes.txt.gz + ## by convention; no CLI arguments) ────────────────────────────────── + kmerread && + + ## ── Summarise results into CSV ──────────────────────────────────────── + python3 /opt/mitokmer2/kmer_read_m7.py + -i ./jobs1 + -o '${results_csv}' + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@misc{githubmitokmer2, + author = {Mammel, Mark}, + title = {mitoKmer2}, + year = {2024}, + publisher = {GitHub}, + journal = {GitHub repository}, + url = {https://github.com/mmammel8/mitokmer2}, +} + + + diff -r 000000000000 -r adc887a1a6de tool-data/mitokmer_probe_db.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/mitokmer_probe_db.loc.sample Fri Sep 11 21:58:43 2026 +0000 @@ -0,0 +1,18 @@ +# mitoKmer Probe Database Location File +# +# This file lists the mitochondrial k-mer probe databases available to mitoKmer. +# Entries are tab-separated; do NOT use spaces as delimiters. +# +# Columns (tab-separated): +# value - unique identifier used internally by Galaxy (no spaces) +# name - human-readable label shown in the tool dropdown +# path - absolute path to the gzipped probe file (mitoch_probes.txt.gz) +# +# Example entry (remove the leading # to activate): +# +# mito_v1 Mitochondrial DB v1 /galaxy/tool-data/mitokmer/mitoch_probes_v1.txt.gz +# +# Multiple databases can be listed, one per line: +# +# mito_insects_v1 Insect Mitochondrial DB v1 /galaxy/tool-data/mitokmer/mitoch_probes_insects_v1.txt.gz +# mito_vertebrates_v1 Vertebrate Mitochondrial DB v1 /galaxy/tool-data/mitokmer/mitoch_probes_vertebrates_v1.txt.gz diff -r 000000000000 -r adc887a1a6de tool_data_table_conf.xml.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.sample Fri Sep 11 21:58:43 2026 +0000 @@ -0,0 +1,7 @@ + + + + value, name, path + +
+
\ No newline at end of file