8000 Signal EDAM load failure and widen the extension map by TilakSharma07 · Pull Request #4469 · nf-core/tools · GitHub
[go: up one dir, main page]

Skip to content

Signal EDAM load failure and widen the extension map - #4469

Open
TilakSharma07 wants to merge 1 commit into
nf-core:devfrom
TilakSharma07:fix-edam-coverage-and-failure-signalling
Open

TilakSharma07 wants to merge 1 commit into
nf-core:devfrom
TilakSharma07:fix-edam-coverage-and-failure-signalling

Conversation

@TilakSharma07
Copy link
Copy Markdown

Fixes #4468.

What was wrong

load_edam() returned a bare dict, so a failed download and "no
matching term 8000 " were the same value. _add_edam_ontologies then set
section["ontologies"] = [] regardless, which records "this file has no
ontology" on the strength of a requests exception.

Separately the map was keyed only on column 14 of EDAM.tsv ("File
extension"), which EDAM 1.25 populates for 61 of 728 format_*
concepts. The formats nf-core modules mostly emit were absent:

extension before after
bam absent format_2572
fasta absent format_1929
vcf absent format_3016
bed absent format_3003
cram absent format_3462
sam absent format_2573
gtf absent format_2306

What changed

load_edam(cache_dir) returns (mapping, ok). The caller unpacks it and
passes edam_ok down, so the empty-list write is skipped when the
ontology did not load. Keying additionally on the lowercased preferred
label and single-token exact synonyms takes the map from 67 to 798 keys;
tokens claimed by more than one concept are dropped rather than guessed.

Measured impact

Across the 184 modules used by nf-core/rnaseq and nf-core/sarek, 1538
file channel elements currently receive no ontology; 513 of them become
annotatable.

Tests

tests/modules/test_load_edam.py — 14 cases: the failure signal
(connection error, unreadable cache), the success signal, caching of a
download, the widened keys, the curated column still winning on a
conflict, ambiguous tokens being dropped, and non-format concepts being
ignored.

The fixture is a hand-cut slice of EDAM 1.25 — 11 real rows, with URIs,
labels, synonyms and "File extension" values copied verbatim — so the
tests need no network access and add no large blob to the repository. On
that same fixture the current code yields 3 keys (fq, fastq,
xlsx), with bam, fasta, vcf, bed and cram all absent;
the patched code yields 12, with those five resolving.

They are in a separate file so the diff stays reviewable — happy to fold
them into tests/modules/test_modules_utils.py if you prefer.

@codecov
codecov Bot commented Sep 11, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.18%. Comparing base (b9d9e05) to head (65b5c95).
⚠️ Report is 7 commits behind head on dev.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TilakSharma07
TilakSharma07 changed the base branch from main to dev September 12, 2026 11:38
load_edam() keeps its original contract (returns dict, callable with no
arguments) so existing callers and tests are unaffected. The new
load_edam_with_status() returns (formats, ok) and the module linter uses
it to skip writing the ontologies key when the ontology could not be
loaded, instead of silently emitting an empty annotation.

The extension map is widened from 156 to 653 annotatable file elements
across 184 modules.

Adds tests/modules/test_load_edam.py covering the parser, the public
API contract and the failure path.
@TilakSharma07
TilakSharma07 force-pushed the fix-edam-coverage-and-failure-signalling branch from 8c07d58 to 65b5c95 Compare September 12, 2026 11:46

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.

nf-core/tools: EDAM ontology map covers 61 of 728 format concepts, and a failed download is indistinguishable from "no term exists"

1 participant

0