Skip to content

feat(galaxy): add tool wrappers for all five subcommands - #18

Merged
Paururo merged 3 commits into
mainfrom
feat/galaxy-wrappers
Aug 16, 2026
Merged

feat(galaxy): add tool wrappers for all five subcommands#18
Paururo merged 3 commits into
mainfrom
feat/galaxy-wrappers

Conversation

@Paururo

@Paururo Paururo commented Aug 16, 2026

Copy link
Copy Markdown
Member

Five Galaxy tools, one per subcommand, ready to submit to galaxyproject/tools-iuc.

Where this sits

Three of the four prerequisites were already met, which is why this is mostly wrapper work:

Bioconda 1.0.2 published, 577 downloads
BioContainer built automatically: quay.io/biocontainers/pathotypr:1.0.2--hef77e2b_0
bio.tools registered as pathotypr
Galaxy wrapper this

Nothing is vendored; the wrappers declare the conda package.

Verified

planemo lint clean on all five, no warnings, no errors
planemo test 8 of 8 pass
Mutation check breaking the output prefix so it no longer matches from_work_dir fails both classify tests

That last line is the one that matters: it is how we know the assertions read the real outputs rather than passing because nothing was checked.

Test data: 64 KB, and not filler

A 2 kb synthetic reference, eight markers, two samples, paired reads at about 18x, and a twelve-genome training set in two classes. Generated deterministically by a script kept next to it.

The generator asserts that every marker k-mer occurs exactly once in the reference, in both orientations. A marker matching in two places would make the tests pass for the wrong reason.

The expected calls follow from how the samples were built, and they cross-check each other:

  • sample1 carries L2 to L2.1 to L2.1.1 plus a RIF marker, so classify calls L2 and reports rpoB / S450L
  • split-fastq on the same sample's reads produces the same summary as classify on its assembly, which is exactly the property the marker format promises
  • predict assigns the two held-out queries to L2 and L3
  • match picks ref_A, which is sample1's own genome

Three things that had to be worked around

None of these is visible in the CLI help. All three were found by running the tools.

  1. classify and split-fastq take the sample name from the input filename. Galaxy datasets arrive as dataset_NNN.dat, so the outputs would have been named after a Galaxy id. Inputs are symlinked to stable names first.
  2. match writes the absolute paths of its inputs into the first column of its report. Those differ between instances, so the same fix applies.
  3. --min-alt-percent is parsed as an integer. A Galaxy float parameter renders 95.0, which the tool rejects with invalid digit found in string. It is declared as an integer here.

That third one is worth a second look outside this pull request: min_alt_percent: u32 means a threshold of 99.5% cannot be expressed, even though the comparison itself is done in f32. For separating clonal samples from mixtures, the step from 99 to 100 is a coarse one. Nothing here depends on changing it, and the documentation does not claim otherwise, so it is recorded rather than acted on.

Not included, on purpose

Marker panels and models come from the history. A data manager plus a .loc table would let an administrator install the published MTBC panels once so users pick them from a dropdown, which is how Galaxy normally handles reference data. Shipping a data table with nothing to populate it would move the burden to administrators without helping anyone, so it is left as its own piece of work.

Submitting

The layout matches tools-iuc, so submission is cp -r galaxy/tools/pathotypr <tools-iuc>/tools/, then a pull request there. Their CI runs the same lint and tests on Linux, where the Bioconda package resolves.

Worth noting for that pull request: TB-Profiler is already in Galaxy, but fastlin is not, so there is currently no alignment-free MTBC lineage typer on the platform.

Five Galaxy tools, one per subcommand, sharing a macros.xml. The layout matches
galaxyproject/tools-iuc, so submitting there is a directory copy rather than a
rewrite.

pathotypr is already on Bioconda with a BioContainer built from it and is
registered on bio.tools, so the wrappers declare the conda package and nothing
is vendored.

Verified with planemo: lint is clean on all five with no warnings, and all 8
tests pass. The test suite was itself checked by mutation: changing the output
prefix so it no longer matches from_work_dir fails both classify tests, which is
how we know the assertions read the real outputs.

The test data is 64 KB of synthetic input, generated deterministically by a
script kept alongside it. It is not filler. The generator asserts that every
marker k-mer occurs exactly once in the reference, in both orientations, because
a marker matching in two places would make the tests pass for the wrong reason.
The expected calls follow from how the samples are built, and they cross-check
each other: split-fastq on a sample's reads produces the same summary as
classify on its assembly, which is the property the marker format promises.

Three things had to be worked around, none of which is visible from the CLI
help and all of which were found by running the tools:

  * classify and split-fastq take the sample name from the input filename.
    Galaxy datasets arrive as dataset_NNN.dat, so outputs would have been named
    after a Galaxy id. Inputs are symlinked to stable names first.
  * match writes the absolute paths of its inputs into the report's first
    column, which would differ between instances. Same fix.
  * --min-alt-percent is parsed as an integer. A Galaxy float parameter renders
    95.0, which the tool rejects with "invalid digit found in string". It is
    declared as an integer, which also means fractional thresholds such as
    99.5% are not reachable.

Marker panels and models come from the history for now. A data manager and a
.loc table would let an administrator install the published MTBC panels once,
which is how Galaxy usually handles reference data; that is left as its own
piece of work rather than half-built.
labeler.yml was written before galaxy/ existed and has no catch-all, so the
pull request adding five Galaxy wrappers arrived with no labels at all. The
list has now aged exactly the way the comment in that file predicts a
file-by-file list would.
@Paururo Paururo added area:galaxy Galaxy tool wrappers and their test data area:ci Workflows, checks and repository automation labels Aug 16, 2026
…output

Checked against a current tools-iuc tool rather than from memory, which turned
up three things.

.shed.yml was missing name, type and auto_tool_repositories. That last one is
what turns a directory of five tools into five ToolShed repositories, so
without it the suite would not have been built the way the IUC expects. Its
remote_repository_url also pointed at this repository rather than at the path
the wrappers will live at inside tools-iuc.

The masked FASTA output had no test. It is a collection discovered by pattern,
so its naming is exactly the kind of thing that breaks silently. Verified first
that the file is sample1_masked.fasta, that the discovered designation is
sample1, and that it carries exactly eight Ns, one per marker. The input genomes
contain no N at all, so an N in the output can only have come from masking.

detect_errors stays exit_code rather than the aggressive setting the reference
tool uses. That is now a measured decision: pathotypr writes its INFO log to
stderr, and aggressive scans stderr, so a log line containing the word error
would fail an otherwise correct job.

No EDAM annotations. The reference tool carries none either, and wrong
ontology terms are worse than absent ones.

planemo: lint clean on all five, 9 of 9 tests passing.
@Paururo

Paururo commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

Verified against the real Bioconda package

The one gap in the earlier verification is now closed. planemo test was re-run with real dependency resolution instead of a local binary:

planemo test --conda_dependency_resolution --conda_auto_install tools/pathotypr/

All 9 tests passed.

Provenance of the binary the jobs actually ran, read from the environment planemo built:

Environment __pathotypr@1.0.2 (Galaxy's own naming)
Channel https://conda.anaconda.org/bioconda
Build 1.0.2 h125a5a0_0, subdir osx-64
Binary Mach-O 64-bit executable x86_64, reports pathotypr 1.0.2

The job log shows that environment being activated, and contains zero references to the local build directory, so nothing fell back to a binary that happened to be on PATH.

This exercises the whole chain the IUC CI will exercise: the <requirement> declaration, resolution from Bioconda, environment creation, execution, and the assertions. The only remaining difference is the platform, osx-64 under Rosetta here against linux-64 natively there.

@Paururo
Paururo merged commit 457cc44 into main Aug 16, 2026
4 checks passed
@Paururo
Paururo deleted the feat/galaxy-wrappers branch August 16, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Workflows, checks and repository automation area:galaxy Galaxy tool wrappers and their test data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant