Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#111](https://github.com/nf-core/proteinannotator/pull/111) - nf-core tools template update to 4.1.0. (by @vagkaratzas)
- [#106](https://github.com/nf-core/proteinannotator/pull/106) - nf-core tools template update to 4.0.3. (by @vagkaratzas)

### `Fixed`

- [#115](https://github.com/nf-core/proteinannotator/pull/115) - Fixed `INTERPROSCAN` failing on real databases: updated the `interproscan` module so it uses the staged database ([nf-core/modules#13009](https://github.com/nf-core/modules/issues/13009)), set the default `interproscan_db_url` to the 5.59-91.0 release that matches the container, pass the inner `data/` directory of an untarred release to `INTERPROSCAN`, and removed `PIRSF` from the default `interproscan_applications`, since parallel samples can race to index its HMMs on a fresh database (see usage docs to re-enable it). (by @vagkaratzas)

### `Dependencies`

| Tool | Previous version | New version |
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ params {
metagroot_latest_link = params.pipelines_testdata_base_path + 'proteinannotator/testdata/metagroot/metagroot_test.hmm.gz'
// 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.

kofamscan_profiles_url = params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/profiles.tar.gz'
kofamscan_ko_list_url = params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/ko_list.gz'
}
2 changes: 1 addition & 1 deletion conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ params {
metagroot_latest_link = params.pipelines_testdata_base_path + 'proteinannotator/testdata/metagroot/metagroot_test.hmm.gz'
// 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'
kofamscan_profiles_url = params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/profiles.tar.gz'
kofamscan_ko_list_url = params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/ko_list.gz'
}
2 changes: 1 addition & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Each of the `domain_annotation/` subfolders (e.g., `pfam`, `funfam`, `nmpfams`,
</details>

[InterProScan](https://interproscan-docs.readthedocs.io/en/v5/#) is a protein annotation tool that searches [InterPro](http://www.ebi.ac.uk/interpro/), a database which integrates predictive information about protein function from a number of member resources, giving an overview of the families that a protein belongs to and the domains and sites it contains. The default database applications that are used to functionally annotate sequences include
Hamap, PANTHER, PIRSF, TIGRFAM and sfld, and are set through the `--interproscan_applications` parameter.
Hamap, PANTHER, TIGRFAM and sfld, and are set through the `--interproscan_applications` parameter.

See also [InterProScan output documentation](https://interproscan-docs.readthedocs.io/en/v5/), where most of these examples are taken from.

Expand Down
57 changes: 29 additions & 28 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,43 +85,44 @@ You can also generate such `YAML`/`JSON` files via [nf-core/launch](https://nf-c
[InterProScan](https://github.com/ebi-pf-team/interproscan) is used to provide more information about the proteins annotated on the contigs. By default, turning on this subworkflow without `--skip_interproscan` will download and unzip the InterPro database. The database will then be saved in the output directory `<output_directory>/downloaded_dbs/interproscan_db/`. We recommend keeping a copy of this directory for future reuse in case the results folder is deleted.

> [!NOTE]
> The large database download (5.5GB) can take up to 4 hours depending on the bandwidth.
> The large database download (6.6GB) can take up to 4 hours depending on the bandwidth.

A local version of the database can be supplied to the pipeline by passing the InterProScan database directory to `--interproscan_db <path/to/downloaded-untarred-interproscan_db-dir/>`. The directory can be created by running (e.g. for database version 5.72-103.0):
The database release must match the InterProScan version in the pipeline's container, which is **5.59-91.0**. Newer releases rename or replace member databases (e.g. TIGRFAM was merged into NCBIfam) and will not be found.

```
curl -L https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.72-103.0/interproscan-5.72-103.0-64-bit.tar.gz -o interproscan_db/interproscan-5.72-103.0-64-bit.tar.gz
tar -xzf interproscan_db/interproscan-5.72-103.0-64-bit.tar.gz -C interproscan_db/
A local version of the database can be supplied to the pipeline with `--interproscan_db`. This can be either the untarred release directory or the `data/` directory inside it. The directory can be created by running:

```bash
curl -L https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz -o interproscan-5.59-91.0-64-bit.tar.gz
tar -pxzf interproscan-5.59-91.0-64-bit.tar.gz
```

The contents of the database directory should include the directory `data` in the top level with a number of subdirectories:
This creates the following layout:

```
interproscan_db/
└── data/
├── antifam
├── cdd
├── funfam
├── gene3d
├── hamap
├── ncbifam
├── panther
| └── [18.0]
├── pfam
| └── [36.0]
├── phobius
├── pirsf
├── pirsr
├── prints
├── prosite
| └── [2023_05]
├── sfld
├── smart
├── superfamily
└── tmhmm
interproscan-5.59-91.0/ <- pass this (or its data/ subdirectory) to --interproscan_db
├── bin/
├── data/
│ ├── hamap/
│ ├── panther/
│ ├── pirsf/
│ ├── sfld/
│ ├── tigrfam/
│ └── ...
├── interproscan.properties
├── interproscan.sh
└── setup.py
```

> [!NOTE]
> The HMMs in the 5.59-91.0 release are not pre-indexed. The default applications do not need them indexed. PIRSF is not in the defaults because it indexes its own HMMs the first time it runs, and when several samples run InterProScan in parallel against a fresh database, they may all try to index the same PIRSF files at once. To add PIRSF to `--interproscan_applications`, index the database once before running the pipeline, from inside the untarred release directory (the one containing `setup.py` and `interproscan.properties`, not `data/`):
>
> ```bash
> cd interproscan-5.59-91.0/
> python3 setup.py -f interproscan.properties
> ```
>
> For a database downloaded by the pipeline, run the same command inside `<output_directory>/downloaded_dbs/interproscan_db/`, then reuse that directory with `--interproscan_db`.

### KOfamScan

[KOfamScan](https://github.com/takaram/kofam_scan) assigns KEGG Orthologs to protein sequences using the KOfam profile HMM database and KO-specific score thresholds. It runs by default and can be disabled with `--skip_kofamscan`.
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"interproscan": {
"branch": "master",
"git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120",
"git_sha": "3137cddd6fa5fd47e1673081fa82a12644e91996",
"installed_by": ["modules"]
},
"kofamscan": {
Expand Down
8 changes: 6 additions & 2 deletions modules/nf-core/interproscan/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions modules/nf-core/interproscan/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ params {

// 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).

interproscan_db = null
interproscan_applications = 'Hamap,PANTHER,PIRSF,TIGRFAM,sfld'
interproscan_applications = 'Hamap,PANTHER,TIGRFAM,sfld'
interproscan_enableprecalc = false
skip_kofamscan = false
kofamscan_profiles_url = "https://www.genome.jp/ftp/db/kofam/profiles.tar.gz"
Expand Down
10 changes: 5 additions & 5 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,22 @@
},
"interproscan_db_url": {
"type": "string",
"default": "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.72-103.0/interproscan-5.72-103.0-64-bit.tar.gz",
"help_text": "This allows the user to change the InterProScan database version that the pipeline will download for you automatically. To instead use a pre-downloaded database, please supply its path to `--interproscan_db`. Changing this URL allows for the use of the latest database release. By default this is set to `http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.72-103.0/interproscan-5.72-103.0-64-bit.tar.gz`. ",
"default": "https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz",
"help_text": "This allows the user to change the InterProScan database version that the pipeline will download for you automatically. To instead use a pre-downloaded database, please supply its path to `--interproscan_db`. The release must match the InterProScan version of the pipeline's container (5.59-91.0), so do not point this at a newer release. By default this is set to `https://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.59-91.0/interproscan-5.59-91.0-64-bit.tar.gz`.",
"description": "Change the database version used for annotation.",
"fa_icon": "fas fa-database"
},
"interproscan_db": {
"type": "string",
"help_text": "Use this to supply the path to a pre-downloaded InterProScan database. This can be any unzipped InterProScan version.\n\nFor more details on where to find different InterProScan databases see tool [documentation](https://interproscan-docs.readthedocs.io/en/latest/UserDocs.html#obtaining-a-copy-of-interproscan).\n",
"help_text": "Use this to supply the path to a pre-downloaded InterProScan database. This must be an untarred InterProScan 5.59-91.0 release, matching the pipeline's container. Either the release's top-level directory or its inner `data/` directory can be supplied.\n\nFor more details on where to find different InterProScan databases see tool [documentation](https://interproscan-docs.readthedocs.io/en/latest/UserDocs.html#obtaining-a-copy-of-interproscan).\n",
"description": "Path to pre-downloaded InterProScan database.",
"fa_icon": "fas fa-database"
},
"interproscan_applications": {
"type": "string",
"default": "Hamap,PANTHER,PIRSF,TIGRFAM,sfld",
"default": "Hamap,PANTHER,TIGRFAM,sfld",
"pattern": "^\\w+(,\\w+)*",
"help_text": "A comma-separated string specifying the database(s) to be used to annotate the coding regions annotated during the contig annotation workflow of the pipeline. By default these include `Hamap,PANTHER,PIRSF,TIGRFAM,sfld`.\n\nFor more information about all possible databases see the tool [documentation](https://interproscan-docs.readthedocs.io/en/v5/HowToRun.html).\n\n> Modifies tool parameter(s):\n> - InterProScan: `--applications`",
"help_text": "A comma-separated string specifying the database(s) to be used to annotate the coding regions annotated during the contig annotation workflow of the pipeline. By default these include `Hamap,PANTHER,TIGRFAM,sfld`.\n\nFor more information about all possible databases see the tool [documentation](https://interproscan-docs.readthedocs.io/en/v5/HowToRun.html).\n\n> Modifies tool parameter(s):\n> - InterProScan: `--applications`",
"description": "Assigns the database(s) to be used to annotate the coding regions.",
"fa_icon": "fas fa-database"
},
Expand Down
4 changes: 4 additions & 0 deletions subworkflows/local/functional_annotation/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ workflow FUNCTIONAL_ANNOTATION {
.first()
}

// 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


INTERPROSCAN( ch_fasta, ch_interproscan_db )
ch_interproscan_tsv = INTERPROSCAN.out.tsv
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process {
withName: INTERPROSCAN {
ext.args = '--applications Hamap,TIGRFAM,sfld --disable-precalc'
ext.args = '--applications TIGRFAM,sfld --disable-precalc'
memory = 12.GB
cpus = 1
}
Expand Down
Loading