# HG changeset patch
# User galaxytrakr
# Date 1789415225 0
# Node ID dd206296acbf2f502ce3d81173224c29394a8c9b
# Parent e6b5e7a0d7e7f6ab29a441ca9d6a7290db1aa8ac
planemo upload commit 83cba09882dc583100b39b69b41cf791e4efb55a
diff -r e6b5e7a0d7e7 -r dd206296acbf Dockerfile
--- a/Dockerfile Fri Sep 11 22:01:39 2026 +0000
+++ b/Dockerfile Mon Sep 14 19:47:05 2026 +0000
@@ -37,10 +37,10 @@
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
+# Compile kmer_read_1.cpp -> kmerread7
+# kmer_read_m7.py calls ./kmerread7 as a subprocess
+RUN g++ -O3 kmer_read_1.cpp -o kmerread7 -lz && \
+ chmod +x kmerread7
# Install any Python requirements declared in the repo
RUN if [ -f requirements.txt ]; then \
@@ -64,22 +64,25 @@
&& rm -rf /var/lib/apt/lists/*
# Copy compiled binary from build stage
-COPY --from=build /opt/mitokmer2/kmerread /usr/local/bin/kmerread
+# kmerread7 is called by kmer_read_m7.py as ./kmerread7 so it
+# must be in the working directory at runtime; place it in both
+# /usr/local/bin (for PATH) and /opt/mitokmer2 (for relative invocation)
+COPY --from=build /opt/mitokmer2/kmerread7 /usr/local/bin/kmerread7
+COPY --from=build /opt/mitokmer2/kmerread7 /opt/mitokmer2/kmerread7
# 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
+# Refresh the dynamic linker cache
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 && \
+RUN chmod a+rx /usr/local/bin/kmerread7 \
+ /opt/mitokmer2/kmerread7 && \
chmod -R a+rX /opt/mitokmer2 && \
chmod -R a+rX /opt/venv
diff -r e6b5e7a0d7e7 -r dd206296acbf mitokmer.xml
--- a/mitokmer.xml Fri Sep 11 22:01:39 2026 +0000
+++ b/mitokmer.xml Mon Sep 14 19:47:05 2026 +0000
@@ -5,41 +5,44 @@
+ ## jobs file: ./jobs7m/jobs7m.txt
+ ## output: ./jobs7m/jobs7m.csv
+ ## binary: ./kmerread7 (called as subprocess by the Python script)
+ mkdir -p ./mitochondria7 ./jobs7m &&
+
+ ## ── Link database files from the data table directory ─────────────────
+ ## The data table path points to a directory containing all the
+ ## mitochondria7 .txt files; symlink each one into ./mitochondria7/
+ ln -sf '${probe_db.fields.path}'/* ./mitochondria7/ &&
- ## ── Link probe database to the path kmerread expects ─────────────────
- ln -sf '${probe_db.fields.path}' ./mitoch/mitoch_probes.txt.gz &&
+ ## ── Symlink kmerread7 into the working directory ──────────────────────
+ ## kmer_read_m7.py calls ./kmerread7 (relative path), so it must exist
+ ## in the Galaxy job working directory
+ ln -sf /usr/local/bin/kmerread7 ./kmerread7 &&
- ## ── Stage input reads ─────────────────────────────────────────────────
+ ## ── Write the jobs file ───────────────────────────────────────────────
+ ## Format: sample_name num_files
+ ## /abs/path/to/read1
+ ## /abs/path/to/read2 ...
+ #set sample_name = $reads[0].element_identifier.replace(' ', '_').split('_')[:-1] | join('_')
+ printf '${sample_name}\t${reads|length}\n' > ./jobs7m/jobs7m.txt &&
#for read in $reads
- ln -sf '${read}' ./reads/${read.element_identifier.replace(' ', '_')} &&
+ printf '${read.file_name}\n' >> ./jobs7m/jobs7m.txt &&
#end for
- ## ── Write the jobs file in the format kmerread expects ───────────────
- ## Line 1:
- ## 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 the Python orchestrator (no arguments) ────────────────────────
+ ## kmer_read_m7.py reads jobs7m/jobs7m.txt, calls ./kmerread7,
+ ## and writes results to jobs7m/jobs7m.csv
+ python3 /opt/mitokmer2/kmer_read_m7.py &&
- ## ── 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}'
+ ## ── Copy output CSV to Galaxy output path ─────────────────────────────
+ cp ./jobs7m/jobs7m.csv '${results_csv}'
]]>
-
+