Skip to content

Galaxy - #15

Open
LukaLmelias wants to merge 33 commits into
bge-barcoding:mainfrom
naturalis:galaxy
Open

LukaLmelias wants to merge 33 commits into
bge-barcoding:mainfrom
naturalis:galaxy

Conversation

@LukaLmelias

@LukaLmelias LukaLmelias commented Oct 22, 2026 •

Copy link
Copy Markdown

Add Galaxy wrapper for BeeGees

Adds a Galaxy tool wrapper under beegees/galaxy/. It also adds CI that lints, tests and publishes the wrapper to the Galaxy Tool Shed.

What's included

  • Wrapper (beegees.xml, macros.xml, build_*.py): runs BeeGees from a FASTQ collection and a samples CSV. Takes protein references from gene-fetch or manual upload, and uses BLAST taxonomy through Galaxy data tables.
  • Test data and planemo test coverage.
  • Release workflows:
    • toolshed_deploy.yml: lint and test on every push. Uploads to the Tool Shed on galaxy-<version>+galaxy<N> tags, kept separate from the v* package tags used for Bioconda.
    • galaxy_autoupdate.yml: checks Bioconda daily and opens a PR that bumps the wrapper when a new beegees release is published.
    • galaxy_tag.yml: when a version bump in macros.xml is merged to main, creates the matching galaxy-* tag, which triggers the upload.

Setup needed by maintainers

  • Add a TOOLSHED_API_KEY secret (Tool Shed account that will own the repo)
  • Add a GALAXY_AUTOUPDATE_TOKEN secret: a fine-grained token from an account with write access here, with read/write access to Contents and Pull requests

Note: merging this tags and publishes galaxy-3.0.4+galaxy4. The first autoupdate run then opens a PR bumping it to 3.0.7.

luka lenaroto and others added 30 commits August 18, 2026 16:00
beegees.xml:
- Loop over the multi-select r/s values directly instead of calling
  .split(), which the select wrapper doesn't support
- Match collection files by element_identifier instead of dataset name
- Add a sanitizer to the gene-fetch email field so '@' isn't turned
  into '__at__'

build_samples_csv.py:
- Symlink each collection file into a reads/ dir under its real name,
  so Galaxy's .dat names don't hide the gzip extension from fastp
- Add or remove the .gz suffix based on the file's gzip magic bytes
- Stop accepting absolute paths in the samples CSV, so only files from
  the input collection can be used
- Error out if two different files would get the same link name
- Add --reads-dir option (default: reads)
- Print a [BeeGees] Step N/4 banner before each stage
- On failure, report which stage failed on stderr and exit 1
- Check the plots directory exists before zipping it
- Fall back to matching on the name without FASTQ extensions
  (.fastq/.fq/.fastqsanger[.gz]) when there is no exact match
- Error if a filename matches more than one collection element
- Stop matching on Galaxy's internal dataset_*.dat filenames
The pipeline requires an expected taxonomy file, but the wrapper made it
optional and wrote null, so Snakemake aborted at startup.

- Remove the separate expected taxonomy input from the tool form
- Always set taxonomic_validation.expected_taxonomy to the samples CSV
- Require phylum/class/order/family/genus/species columns in the samples
  CSV (values may be empty) and fail at step 1 if any are missing
- Update form and help text accordingly
The sequence references CSV pointed at server paths that users cannot
create in Galaxy, so MitoGeneExtractor failed with missing input files.

- Add a flat list collection input for protein reference FASTAs
- protein_reference_path in the references CSV is now a bare filename,
  matched against the collection (with or without FASTA extension)
- Link matched files into references/ and write a resolved
  sequence_references.csv, which is passed to the pipeline config
- Fail at step 1 if a sample has no reference, a filename is not in the
  collection, or required columns are missing
Pipeline scripts join relative output paths onto their own output dir
(e.g. 02_at_content_filter.py), so a relative output_dir made the AT
filter write at_filtered.txt to a non-existent nested path and Snakemake
failed with MissingOutputException.

- Write samples_file, output_dir, sequence_reference_file and
  expected_taxonomy as absolute paths in the job working directory
- Also removes Snakemake's './' relative path warnings
tv_local_blast.py only builds a database from files ending in
.fasta/.fa/.fas, and the pipeline checks that blast_db exists as a path,
so neither an uploaded dataset (.dat) nor a blastdb data table prefix
worked.

- Uploaded FASTA: link it as blast_db/blast_db.fasta so makeblastdb runs
  and writes the index into the job directory
- Pre-installed (blastdb.loc): link all <prefix>.* files into blast_db/
  plus an empty <prefix> placeholder so the existence checks pass; fail
  at step 2 if no files match the prefix
- Write blast_db to the config as an absolute path
- Fix column order in the blastdb.loc.sample header (value, name, path)
The plots archive step (zip -rj) failed with 'zip: command not found'
because zip was not part of the job's conda environment. Declare
zip=3.0 from conda-forge so it is always installed.
zip failed because Galaxy pre-creates output files empty, and zip treats
an existing file as an archive to update ('Zip file structure invalid').

- Replace the zip step with a list collection of the PNGs discovered in
  beegees_output/05_barcoding_outcome/plots (command is now 3 steps)
- Remove the zip requirement again
- Add a required 'Analysis name' input (letters, digits, - and _) and
  label all outputs as {analysis_name}_beegees_{output}
The lint fix converted the downsampling and reference_filter test params
from boolean to select but left the command template unchanged: the
downsampling param was renamed and max_reads dropped, and the select value
'false' is truthy in Cheetah, so both branches broke every run.

- restore downsampling `enabled`/`max_reads` (keeping the select)
- compare both conditionals against 'true' in the command
- fix indentation of the downsampling and reference_filter blocks
- stop tracking instance-specific tool-data/*.loc; ship only .loc.sample

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build_samples_csv.py rebuilt each row from a fixed column list, so a
taxid column was dropped before gene-fetch read the resolved samples CSV
and the taxid input type could never work.

- keep every uploaded column; only rewrite forward/reverse paths
- add --require-taxid (set in gene-fetch taxid mode) to fail early on a
  missing or empty taxid
- reject rows with more fields than the header
- document the taxid column in the tool form and help
- wrap a long line in build_config_yaml.py (flake8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- samples and sequence references inputs accept only csv; the wrapper
  scripts parse them comma-separated, so tabular uploads were misread
- taxonomic_validation_csv is comma-separated; declaring it tabular made
  Galaxy show it as a single column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Added two package requirements that are required in order to make a working mulled container image using "planemo mull"
* Also added the location of the resulting container image built out of this as a docker type requirement.
* This allows the tool to run using a container image (docker/apptainer) as well as the traditional Conda way,
Added several requirements for working container image.
Separate Galaxy wrapper releases from package releases: the Tool Shed
upload now runs on galaxy-<TOOL_VERSION>+galaxy<VERSION_SUFFIX> tags and
checks the tag against macros.xml. A daily workflow opens a PR when
Bioconda has a newer beegees, and merging a macros.xml change to main
creates the matching galaxy-* tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant