Repository navigation
humann: offer only reference data the tool accepts; make the data manager emit stable identities - #9094
Open
bernt-matthias wants to merge 9 commits into
Open
humann: offer only reference data the tool accepts; make the data manager emit stable identities #9094bernt-matthias wants to merge 9 commits into
bernt-matthias wants to merge 9 commits into
Conversation
bernt-matthias
marked this pull request as draft
November 27, 2026 20:15
This was referenced Nov 27, 2026
Closed
…names Galaxy workflows serialize data table selector values, so a value built from `date.today()` makes identical reference data incompatible across Galaxy instances and non-reproducible across two installs on the same instance (galaxyproject#5681). The three HUMAnN tables are affected. HUMAnN advertises its reference bundles by artifact name (queried via `humann_databases --available`), e.g. `full_chocophlan.v201901_v31`. That name changes when the data changes and is identical everywhere, so use it as the identity: value = "<database>-<build>-<source id>" name = "<label> (<source id>)" dbkey = the HUMAnN version the entry was installed for (provenance) The managed path is derived from `value` (data_manager_conf.xml), so the same bundle now lands on the same path on every server instead of a dated one. `name` carries the artifact name because the labels alone are not unique across data generations (HUMAnN 3.0.x shipped `chocophlan.v296_201901b`, 3.1.1-3.9 shipped `v201901_v31`, a future HUMAnN 4 will ship `v4_alpha`), and it is what the tool form shows. Also pass the download command as an argument list instead of a shell string, and drop a stray `args.` from `download_humann_db()` (it made the function depend on the module globals). Based on the humann part of galaxyproject#8361 only (the MetaPhlAn data manager changes in that PR are not included). Co-authored-by: Matthias Bernt <m.bernt@ufz.de>
3 of 5 tasks
bernt-matthias
marked this pull request as ready for review
November 27, 2026 20:43
The help was two lines: nothing told an admin which of the installed bundles works with which HUMAnN, or why two entries can carry the same label. Document the properties that matter for choosing data: - what the three tables feed (ChocoPhlAn/UniRef/mappings); - that the data generation is part of the artifact name and that `v201901_v31` + `201901b` are the same for every HUMAnN 3.1.1 - 3.9, i.e. `dbkey` is provenance, not a data version; - the HUMAnN 3.0.x exception (`chocophlan.v296_201901b`) and the runtime error it causes in later releases; - the independent MetaPhlAn marker database and which releases HUMAnN accepts, plus the `metaphlan >=4.0,<4.2` pin of the humann package; - the column semantics, in particular why `value` never carries a date; - how to add data by hand and what a re-install does. The `.loc.sample` headers claimed the columns were `db-build-version-date / db-name / build / path`, which is wrong in all six files (the columns are `value, name, dbkey, path`); replace them with a description of the actual scheme and one example row. Also drop the stale "HUMAnN2" wording from `.shed.yml`.
HUMAnN validates the version strings in the file names of the reference data directories and aborts if one does not match, so the selectors must not offer incompatible data: - ChocoPhlAn: HUMAnN 3.1.1 - 3.9 require `v201901_v31`; HUMAnN 3.0.x installed `v296_201901b`, which aborts any later release with "CRITICAL ERROR: The directory provided for ChocoPhlAn contains files ... that are not of the expected version". Such rows exist on live servers (a 3.0.0 cohort next to the working 3.6.0/3.9 ones). - UniRef: every HUMAnN 3.x release requires the `201901b` bundle. Entries installed by older versions of the data manager carry an install date instead of the artifact name, so both spellings are accepted; the incompatible 3.0.x cohort is excluded by `dbkey`, which is the HUMAnN version the entry was installed for and the only structural marker for the v296_201901b generation. A future HUMAnN 4 data generation (`v4_alpha`) matches neither spelling and is therefore excluded as well. Additionally fix the utility mapping filters, which did not filter what they claimed: `.*map.*(?!_name)` in the regroup tool keeps every row (`utility_mapping` alone matches `.*map`, and the lookahead at the end of the pattern always succeeds), so name mappings were offered as groupings. Anchor both filters on the mapping file name instead: the regroup tool now selects `map_*` mappings without `_name`, the rename tool exactly the `*_name` ones. Verified against Galaxy's implementation: `<filter type="regexp">` uses `re.match` (anchored at the start) and resolves column names to indices.
The prescreen step runs MetaPhlAn and HUMAnN then checks the profile for
the marker database generation it was built for ("v3" or "vJun23" in a
header comment); a profile from any other release is rejected with "The
MetaPhlAn taxonomic profile provided was not generated with the database
version ...". HUMAnN 3.9 therefore accepts the vJun23 databases and pre-v4
ones, but not vJan21 (HUMAnN 3.5/3.6) or vOct22 (3.7/3.8).
The wrapper read the unversioned `metaphlan_database` table, whose rows
carry no marker-database generation, and its filter was an accidental
allowlist ("" keeps the matching rows) of exactly the values of vOct22,
TOY and demo databases: on usegalaxy.eu the only row offered was
`mpa_vOct22_SGBCHOCOPhlAn_202212`, which HUMAnN 3.9 rejects, while the
vJun23 database installed by the MetaPhlAn data manager was not visible at
all.
Read `metaphlan_database_versioned` instead, which the MetaPhlAn data
manager writes (5 columns, the last one recording whether the database is
pre-v4), and hide the generations that this HUMAnN cannot consume. Entries
with `db_version` "legacy" additionally get the `--mpa3` switch, which is
what makes MetaPhlAn 4 read a pre-v4 database.
Note that the `value` column of the versioned table still ends with the
install date, so selecting from the table keeps the wrapper unusable for
HUMAnN in workflows shared between servers; that is a separate defect in
the MetaPhlAn data manager.
…aning The comment headers of the tool test data tables still listed the columns as "db-build-version-date / db-name / build / path", which is not what the tables hold, and they are what an admin sees when copying a sample file. Point them at the documented samples instead of repeating the explanation and fix the marker database sample, whose value column documents the install date that the data manager writes.
The humann tool no longer selects the same marker database (the versioned table, incompatible generations hidden, mpa3 for pre-v4 databases), and the regroup/rename tools no longer offer the mapping files they used to offer, so the behaviour of the suite changes. The data manager writes different `value`s, which changes what existing and new selections mean. Also let the humann tool use @VERSION_SUFFIX@ like every other wrapper of the suite instead of hardcoding +galaxy1.
The pin in the bioconda recipe had to be tightened from <4.2 to <4.1.2: MetaPhlAn 4.1.2 made `metaphlan --version` print a second line, and humann 3.9 parses the last line of that output, so any nucleotide-mode run without a default MetaPhlAn database stops with "Can not call software version for metaphlan".
The help said which databases exist, but not how their names relate to versions: ``vOct22`` is the marker release tag that HUMAnN tests in the profile header, while ``_202212`` is only the build date of that tarball (and the same date suffix can appear under different release tags). Describe that scheme, the fact that the 3.x bundles are unchanged from 3.1.1 to 3.9, and which marker releases each HUMAnN generation accepts. The MetaPhlAn version coupling is mentioned as a property of the tools rather than of a package recipe, since that is what a Galaxy user can act on.
The data manager help was a single sentence, so an admin had no way to tell which index to install, how the names are built (marker release tag versus build date), how large the download is, which HUMAnN accepts which release, or why the pre-v4 database is missing from the list (MetaPhlAn 4.x looks for it under a path where it no longer exists). The tool help gains the same naming scheme and notes that the chosen database ends up in the profile header, which is what downstream tools check.
bernt-matthias
force-pushed
the
humann-reference-data
branch
from
November 27, 2026 20:47
1d03d1b to
fbd4437
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
supersedes #7679 and #5309
reuses parts from #8361
requires bioconda/bioconda-recipes#72292
Problems solved
Main changes
Not in this PR: the MetaPhlAn version pin. It belongs to the humann conda package (bioconda/bioconda-recipes#72292), not to a wrapper , which cannot constrain what the package pulls in.
Full analysis: https://gist.github.com/bernt-matthias/1b49e242a977655b21fe5c4828d40fa2
FOR CONTRIBUTOR:
tool update guide)
There are two labels that allow to ignore specific (false positive) tool linter errors:
skip-version-check: Use it if only a subset of the tools has been updated in a suite.skip-url-check: Use it if github CI sees 403 errors, but the URLs work.To request a review once your PR is ready, comment "please review" on the PR. This will
automatically apply the
ready-for-reviewlabel if the PR is not a draft, all reviewthreads are resolved, and all CI checks have passed. The label is removed once a reviewer
submits a review; after addressing it, comment "please review" again to ping the reviewers.