Skip to content

Fix InterProScan ignoring staged database - #115

Merged
vagkaratzas merged 3 commits into
devfrom
bugfix-interproscan
Sep 27, 2026
Merged

vagkaratzas merged 3 commits into
devfrom
bugfix-interproscan

Conversation

@vagkaratzas

Copy link
Copy Markdown
Collaborator

Closes #114.

Changes

  • Update the interproscan module to pick up the fix for interproscan: staged database is ignored (relative INTERPROSCAN_CONF, wrong bin/data directories) modules#13009. The module now sets data.directory to the staged data/ and uses an absolute INTERPROSCAN_CONF, so the database passed to the pipeline is actually used instead of the container's sample data.
  • Default interproscan_db_url to the 5.59-91.0 release, matching the module's container (bioconda stopped at 5.59). The 5.72-103.0 release has different member database paths (e.g. panther/19.0, hamap/2023_05, TIGRFAM replaced by NCBIfam) that 5.59 cannot find.
  • FUNCTIONAL_ANNOTATION: pass the inner data/ directory to INTERPROSCAN when the database directory contains one. Applies to both the downloaded database and --interproscan_db, so either the untarred release directory or its data/ can be supplied.
  • Test profiles: TIGRFAM,sfld instead of Hamap,TIGRFAM,sfld, matching the module test. The test tarball ships hamap/2023_05, while 5.59 expects 2021_04.
  • docs/usage.md and schema help: document the 5.59-91.0 requirement, the release layout, and where to run python3 setup.py -f interproscan.properties to pre-index the HMMs. The default applications do not need indexed HMMs except PIRSF, which indexes its own on first run; pre-indexing avoids parallel tasks doing that at the same time.

Testing

  • subworkflows/local/functional_annotation nf-test and pipeline -profile test nf-test pass (singularity), snapshots unchanged.
  • Checked in the task work dir that data.directory points to the staged data/.
  • Pipeline run with --interproscan_db pointing at a release-style <dir>/data/... layout resolves and uses <dir>/data.
  • Not tested against the full 6.6 GB 5.59-91.0 release in CI. A real run with a pressed 5.59-91.0 data/ succeeded earlier via a bind mount workaround.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,singularity --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • CHANGELOG.md is updated.

🤖 Generated with Claude Code

vagkaratzas and others added 2 commits September 26, 2026 10:33
Update the interproscan module to pick up nf-core/modules#13009, so the
staged database is actually used. Default interproscan_db_url to the
5.59-91.0 release matching the container, pass the inner data/ folder of
an untarred release to INTERPROSCAN, and drop Hamap from test profiles
(test tarball ships hamap/2023_05, 5.59 expects 2021_04).

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

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅

Posted for pipeline commit aa70392

+| ✅ 233 tests passed       |+
#| ❔  10 tests were ignored |#
Details

❔ Tests ignored:

  • files_exist - File is ignored: .github/workflows/ci.yml
  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: conf/igenomes_ignored.config
  • files_exist - File is ignored: .github/workflows/linting_comment.yml
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: .github/workflows/branch.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/nf-core-proteinannotator_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-proteinannotator_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-proteinannotator_logo_dark.png

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-09-27 07:35:56

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with Claude Code.

Checked the mechanism rather than re-deriving it:

  • modules/nf-core/interproscan/{main.nf,meta.yml,tests/nextflow_database.config} are byte-identical to nf-core/modules at 3137cddd, so this is a clean nf-core modules update and not a hand-patch.
  • The data/ resolution is right for both layouts. UNTAR strips a leading component only when the archive has a single top-level entry, so the 5.59-91.0 release (interproscan-5.59-91.0/) untars to bin/ data/ setup.py ... and the new map picks data/, while the test tarball (single top-level data/) untars to hamap/ sfld/ tigrfam/ and passes through unchanged. Both end up staged as data, matching data.directory=$PWD/data in the module.
  • The 5.59-91.0 tarball is 6,594,330,558 bytes, so the 6.6 GB in docs/usage.md is right.
  • The test tarball ships hamap/2023_05 and tigrfam/15.0, which matches the reasoning for dropping Hamap from the test profiles.

Four non-blocking points, all about what happens after this merges rather than about the fix. Details inline.

  1. Neither CI path exercises the new data/ branch — the test tarball takes the pass-through side, so the exact layout #114 reported has no test.
  2. Dropping Hamap from the test profiles leaves the default interproscan_applications untested, and the hamap/2023_05 files in the test data unused.
  3. Nothing ties interproscan_db_url to the module's container version, so the next module update that bumps InterProScan re-creates this bug silently.
  4. PIRSF stays in the default applications, so cause 3 of #114 is still live on a default multi-sample run, and hmmpress writing into UNTAR's output also breaks -resume for that task.

Approving — none of this blocks.

Comment thread nextflow.config
// Functional annotation
skip_interproscan = false
interproscan_db_url = "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.72-103.0/interproscan-5.72-103.0-64-bit.tar.gz"
interproscan_db_url = "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default now has to track the InterProScan version in the module's container, and nothing enforces that. The next nf-core modules update that bumps the container re-creates #114 silently, with the same "database not found" failure that only shows up on a real run. A note at the declaration is the cheap guard:

Suggested change
interproscan_db_url = "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz"
// must match the interproscan module's container version: newer releases rename member databases
interproscan_db_url = "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz"

The same coupling applies to interproscan_applications two lines down, since TIGRFAM only exists up to 5.59.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly (luckily?) there are no more interproscan bioconda (+containers) updates for the foreseeable future. Interproscan has become its own Nextflow pipeline now (non nf-core). Updating the nf-core module would mean completely moving the underlying software, and would require NExtflow packaging into biconda which is kinda unusual (for now).


// A full release untars to the whole install; INTERPROSCAN needs its inner data/ folder
ch_interproscan_db = ch_interproscan_db
.map { database -> database.resolve('data').isDirectory() ? database.resolve('data') : database }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch this adds is never taken in CI, so the layout #114 reported has no test.

UNTAR strips a leading component only when the archive has a single top-level entry. interproscan_test.tar.gz has exactly one, data/, so it untars to hamap/ sfld/ tigrfam/ and resolve('data') is not a directory — both the pipeline test and the subworkflow test take the pass-through side. The real 5.59-91.0 release has interproscan-5.59-91.0/ as its single top-level entry and untars to bin/ data/ setup.py ..., which is the only case where the new map does anything.

Repacking the test tarball with a wrapper directory (interproscan-test/data/..., plus a token interproscan.properties) would make the untarred layout match a real release and give this line a test. Worth a follow-up on the test-datasets branch rather than something to hold this PR for.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will exercise this in case the module starts misbehaving another time

Comment thread conf/test.config
// Functional annotation
interproscan_db_url = params.pipelines_testdata_base_path + 'proteinannotator/testdata/interproscan/interproscan_test.tar.gz'
interproscan_applications = 'Hamap,TIGRFAM,sfld'
interproscan_applications = 'TIGRFAM,sfld'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Hamap dropped here and in test_full.config, the default interproscan_applications (Hamap,PANTHER,PIRSF,TIGRFAM,sfld) is no longer covered by any test — and the hamap/2023_05 files in the test tarball are now dead weight. Regenerating the test data with hamap/2021_04 instead would let the test profiles keep using Hamap and stay closer to what a default run does. Same follow-up as the wrapper-directory point on the subworkflow.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the default set has no coverage now. Regenerating the test data with hamap/2021_04 (together with the wrapper-directory repack from the subworkflow thread) is a test-datasets change, so I will leave it for a follow-up rather than this bugfix release.

Comment thread docs/usage.md Outdated
```

> [!NOTE]
> The HMMs in the 5.59-91.0 release are not pre-indexed. The default applications do not need them indexed, except PIRSF, which indexes its own HMMs the first time it runs. When several samples run InterProScan in parallel against a fresh database, they may all try to index the same PIRSF files at once. To avoid this, index the database once before running the pipeline, from inside the untarred release directory (the one containing `setup.py` and `interproscan.properties`, not `data/`):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is leaving PIRSF in the default interproscan_applications deliberate? As it stands, cause 3 in #114 is still live on the default path: a user who runs the pipeline with more than one sample and no pre-existing database gets parallel tasks pressing the same PIRSF HMMs, and the documented fix only applies on a second run via --interproscan_db.

There is a second effect worth naming: the module stages the database as a symlink, so hmmpress writes into UNTAR_INTERPROSCAN's own output directory. That mutates an upstream task's output, which breaks -resume for UNTAR and is the same class of bug as nf-core/modules#12799, independently of the race.

Pressing once in a small local step after UNTAR would close both, and would also make the default download path work unattended. Dropping PIRSF from the default list would be the smaller change. Either is fine by me — just flagging that the default configuration is still the one that fails.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not deliberate, so I dropped it: PIRSF is out of the default interproscan_applications in aa70392 (config, schema, docs, CHANGELOG). The usage note now explains that PIRSF is opt-in and shows how to pre-index the database before adding it back. That removes the race on the default path, and since the default applications never run hmmpress, nothing writes into UNTAR_INTERPROSCAN's output by default either. A one-off local indexing step after UNTAR would let PIRSF go back into the defaults; I will consider it after this release.

On a fresh pipeline-downloaded database, parallel INTERPROSCAN tasks
race to hmmpress the same PIRSF HMMs. Keep it opt-in; usage docs
explain how to pre-index and re-enable it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vagkaratzas
vagkaratzas merged commit 79197a3 into dev Sep 27, 2026
22 checks passed
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.

2 participants