Mercurial > repos > jpayne > refchooser
changeset 2:719889ec4e14 draft
planemo upload commit 92689f52a93241194941ecf374629245c8fb9093
| author | galaxytrakr |
|---|---|
| date | Mon, 16 Mar 2026 15:02:07 +0000 |
| parents | dcf6c2409ebb |
| children | 806262ab8081 |
| files | Dockerfile job_conf.yml refchooser.xml test-data/.gitmodules tool-data/all_fasta.loc.sample |
| diffstat | 4 files changed, 80 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile Mon Mar 16 15:02:07 2026 +0000 @@ -0,0 +1,74 @@ +# ============================================================= +# Dockerfile for refchooser (compatible with Galaxy) +# ============================================================= + +# ---------- Build Stage 1: The "Builder" ---------- +# This stage downloads and prepares all our dependencies. +FROM ubuntu:20.04 AS builder + +# Set versions for our tools to make updates easy. +ARG MASH_VER="2.3" +ARG PYTHON_VER="3.8" + +# Avoid interactive prompts during apt-get install. +ENV DEBIAN_FRONTEND=noninteractive + +# Install all the dependencies needed to build our tools. +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + tar \ + gzip \ + python${PYTHON_VER} \ + python${PYTHON_VER}-venv \ + && rm -rf /var/lib/apt/lists/* + +# Set a working directory for our downloads. +WORKDIR /build + +# --- Install Mash --- +# Download the pre-compiled Linux binary for Mash. +ADD https://github.com/marbl/Mash/releases/download/v${MASH_VER}/mash-Linux64-v${MASH_VER}.tar . +# Unpack the tarball, find the 'mash' executable, and install it to a standard location. +RUN tar -xvf mash-Linux64-v${MASH_VER}.tar && \ + install -m 0755 mash-Linux64-v${MASH_VER}/mash /usr/local/bin/mash + +# --- Install refchooser --- +# Create a Python virtual environment in a standard location. +RUN python${PYTHON_VER} -m venv /opt/venv +# Activate the venv and install refchooser and its dependencies using pip. +ENV PATH="/opt/venv/bin:$PATH" +RUN pip install --no-cache-dir refchooser + + +# ---------- Build Stage 2: The "Runtime" Stage ---------- +# This is our final, lean image that will be used by Galaxy. +FROM ubuntu:20.04 AS runtime + +# Avoid interactive prompts. +ENV DEBIAN_FRONTEND=noninteractive + +# Install only the essential runtime libraries needed by Mash and Python. +RUN apt-get update && apt-get install -y --no-install-recommends \ + libgomp1 \ + python3.8-venv \ + && rm -rf /var/lib/apt/lists/* + +# --- Copy Binaries and Environment from Builder Stage --- + +# Copy the compiled 'mash' binary from the builder stage. +COPY --from=builder /usr/local/bin/mash /usr/local/bin/mash + +# Copy the entire Python virtual environment containing 'refchooser'. +COPY --from=builder /opt/venv /opt/venv + +# --- Final Configuration --- + +# Set the PATH environment variable so the system can find 'mash' and 'refchooser'. +ENV PATH="/opt/venv/bin:$PATH" + +# As a best practice for Galaxy, ensure all users can read and execute the tools. +RUN chmod -R a+rX /opt/venv && \ + chmod a+rx /usr/local/bin/mash + +# IMPORTANT: No ENTRYPOINT. Set a neutral CMD for Galaxy compatibility. +CMD ["/bin/bash"]
--- a/job_conf.yml Mon Dec 08 20:28:57 2025 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -runners: - local: - load: galaxy.jobs.runners.local:LocalJobRunner - workers: 16 - -# handling: -# processes: -# handler0: - -execution: - default: local - environments: - local: - runner: local - docker_local: - runner: local - docker_enabled: true - # container: "auto" - docker_volumes: $defaults - # docker_set_user: null - docker_run_extra_arguments: "--entrypoint ''" - docker_set_user: root - -tools: -- id: refchooser - # handler: handler0 - environment: docker_local - -limits: -- - # Amount of time a job can run (in any environment) before it - # will be terminated by Galaxy. - type: walltime - value: '01:00:00' \ No newline at end of file
--- a/refchooser.xml Mon Dec 08 20:28:57 2025 +0000 +++ b/refchooser.xml Mon Mar 16 15:02:07 2026 +0000 @@ -1,7 +1,8 @@ -<tool id="refchooser" name="Refchooser" version="0.2.1" python_template_version="3.5" profile="21.05"> +<tool id="refchooser" name="Refchooser" version="0.2.1+galaxy0.1" python_template_version="3.5" profile="21.05"> <description>Select centroidal assembly from a collection of closely-related assemblies, for reference purposes</description> <requirements> - <container type="docker">quay.io/galaxytrakr/refchooser:0.2.3</container> + <container type="docker">cfsanbiostatistics/refchooser:0.2.1</container> + </requirements> <command detect_errors="exit_code"><![CDATA[ mkdir ./assemblies && @@ -13,16 +14,15 @@ export BEST=\$(refchooser metrics --sort Mean_Distance --top 1 ./assemblies ./sketches | tail -n 1 | cut -f 1) && echo "*** best accession \$BEST ***" >&2 && mkdir output && - cp ./assemblies/\$BEST.fasta output/\$BEST.fasta && - ls -l output/ + cp ./assemblies/\$BEST.fasta output/\$BEST.fasta ]]></command> <inputs> <param type="data_collection" collection_type="list" name="assemblies" format="fasta" /> </inputs> <outputs> <data name="matrix" label="Refchooser distance matrix for $on_string" format="tsv" hidden="false" /> - <data name="best" format="txt" label="Centroidal_assembly" > - <discover_datasets directory="output" pattern="__designation_and_ext__" ext="fasta" assign_primary_output="true" visible="true" /> + <data name="best" format="txt" label="Best assembly" visible="false" > + <discover_datasets directory="output" pattern="__designation_and_ext__" assign_primary_output="true" visible="true" /> </data> </outputs> <tests>
