Skip to content

traitar module is drafted#9605

Merged
brovolia merged 46 commits intomasterfrom
9575-new-module-traitar3
Feb 11, 2026
Merged

traitar module is drafted#9605
brovolia merged 46 commits intomasterfrom
9575-new-module-traitar3

Conversation

@brovolia
Copy link
Copy Markdown
Contributor

This module runs Traitar3 in phenotype mode to infer phenotype profiles from assembled nucleotide FASTA files, producing tabular trait prediction results per sample.

@brovolia brovolia linked an issue Dec 22, 2025 that may be closed by this pull request
4 tasks
@brovolia brovolia self-assigned this Dec 22, 2025
@brovolia brovolia requested a review from Copilot December 22, 2025 14:04
@brovolia brovolia requested a review from rpetit3 December 22, 2025 14:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new nf-core module for Traitar3, which performs phenotype prediction from assembled nucleotide FASTA files using protein families to infer microbial traits.

  • Implements Traitar3 phenotype mode for trait prediction
  • Provides both script and stub implementations for testing
  • Includes comprehensive test configurations and expected outputs

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
modules/nf-core/traitar/main.nf Core process implementation with Traitar3 phenotype analysis, including script and stub sections for prediction outputs
modules/nf-core/traitar/meta.yml Module metadata defining inputs/outputs, tool information, and EDAM ontology annotations
modules/nf-core/traitar/environment.yml Conda environment specification pinning traitar to version 3.0.1
modules/nf-core/traitar/tests/main.nf.test nf-test implementation with stub test for proteome input
modules/nf-core/traitar/tests/main.nf.test.snap Test snapshot file with expected MD5 checksums for stub outputs
modules/nf-core/traitar/tests/nextflow.config Test-specific Nextflow configuration for module execution
modules/nf-core/traitar/tests/nf-test.config Additional nf-test configuration settings
modules/nf-core/traitar/tests/config/nf-test.config Alternative test configuration file for different test scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/environment.yml Outdated
Comment thread modules/nf-core/traitar/run/main.nf
@brovolia
Copy link
Copy Markdown
Contributor Author

brovolia commented Jan 5, 2026

Hi @rpetit3 could you please review the module? :)

Copy link
Copy Markdown
Contributor

@Joon-Klaps Joon-Klaps left a comment

Choose a reason for hiding this comment

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

Hi @brovolia,

Thanks for contributing Traitar3. I've left a couple of comments but they don't adress everything.

I've noticed that there are some files that shouldn't be there, .nftignore, nf-test.config, config/, ... All this are typicall for pipelines but not within nf-core modules.

I also noticed that the main.nf contains a bit of complexity and bash scripting, try to minimize this as much as possible. If you are struggeling decompressing files, there are plenty of examples already out there that resolve this issue, see this search

I would suggest having a read through the docs on does and don'ts of nf-core modules. I would also suggest to have a look at some already made modules like samtools/stats or trimgalore to get an idea of how the modules are structured.

Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/run/main.nf
Comment thread modules/nf-core/traitar/meta.yml Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
@brovolia brovolia force-pushed the 9575-new-module-traitar3 branch 2 times, most recently from 890405a to a9d7474 Compare January 15, 2026 15:03
Copy link
Copy Markdown
Contributor

@Joon-Klaps Joon-Klaps left a comment

Choose a reason for hiding this comment

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

Still a couple of stuff that needs double checking

Comment thread modules/nf-core/traitar/tests/main.nf.test Outdated
Comment thread modules/nf-core/traitar/tests/main.nf.test Outdated
Comment on lines +58 to +63
"gene_prediction": [

],
"pfam_annotation": [

],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not familar with traitar, is there an easy way to have output files for these variables, by adding more tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When I test the real data, the output turns out to be non-deterministic, so the md5 sums will be different. Will it work if I add content to stub files?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mmh That's then tricky..., depending on which files, you can try and see if there plugins available that facilitates deterministic regions from the files: https://plugins.nf-test.com/.

If there aren't any plugins and you cannot check for specific constant stings in the files. You can just snapshot the outputfile name. In the docs, we've written a few examples down on it. https://nf-co.re/docs/contributing/nf-test/assertions#complex---handling-inconsistent-md5sum-in-output-elements

Comment thread modules/nf-core/traitar/main.nf Outdated
Comment on lines +52 to +53
# Download PFAM data for traitar annotation
traitar pfam pfam_data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These should be given as an input variable; create a new module for it.

Have a look at nextclade/get_dataset as an example. Snapshotting both the db version as well as traitar is best practice.

For testing this module, you can use the downloaded one or use the one from nf-core/testdatasets (look for pfam)

Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/main.nf Outdated
Comment thread modules/nf-core/traitar/meta.yml Outdated
Comment thread modules/nf-core/traitar/meta.yml Outdated
Comment thread modules/nf-core/traitar/meta.yml
@brovolia brovolia force-pushed the 9575-new-module-traitar3 branch 2 times, most recently from e6d796e to 12946f6 Compare January 29, 2026 14:43
@brovolia brovolia requested review from a team as code owners January 29, 2026 14:43
@brovolia brovolia force-pushed the 9575-new-module-traitar3 branch from 12946f6 to 273be60 Compare February 4, 2026 15:47
@github-actions github-actions Bot added the size/l label Feb 4, 2026
Copy link
Copy Markdown
Contributor

@Joon-Klaps Joon-Klaps left a comment

Choose a reason for hiding this comment

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

Almost there

Comment thread modules/nf-core/traitar/pfamget/main.nf Outdated
Comment thread modules/nf-core/traitar/pfamget/meta.yml Outdated
Comment thread modules/nf-core/traitar/pfamget/meta.yml Outdated
Comment thread modules/nf-core/traitar/run/tests/main.nf.test Outdated
Comment thread modules/nf-core/traitar/pfamget/tests/main.nf.test
Comment on lines +2 to +12
"versions": {
"content": [
null,
null
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2026-01-29T09:38:08.995821451"
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think this is an artifcat of previous tests?

Suggested change
"versions": {
"content": [
null,
null
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2026-01-29T09:38:08.995821451"
},

Comment thread .pre-commit-config.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Preferably, don't edit this file in this PR. If you would like to patch this, make a seperate PR and ask people of infrastructure on slack to have a look at it.

Comment thread modules/nf-core/traitar/run/tests/main.nf.test Outdated
Comment thread modules/nf-core/traitar/run/meta.yml Outdated
- pfam_db:
type: directory
description: |
PFAM database directory created by traitar/pfamget module
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
PFAM database directory created by traitar/pfamget module
PFAM database directory created by traitar/pfamget module or downloaded from https://ftp.ebi.ac.uk/pub/databases/Pfam/

@Joon-Klaps
Copy link
Copy Markdown
Contributor

I see in your commit history, the classic fight with linters & prettier is happening. Have a read here how to set it up.
https://nf-co.re/docs/contributing/code_editors_and_styling/code_formatting

@brovolia brovolia force-pushed the 9575-new-module-traitar3 branch from 273be60 to 7ca2f90 Compare February 10, 2026 10:42
Copy link
Copy Markdown
Contributor

@Joon-Klaps Joon-Klaps left a comment

Choose a reason for hiding this comment

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

Sorry 2 morte things that I overlooked, delete the code remenant in pfamget and undo any changes in .precommit-config.yaml please.

Comment thread modules/nf-core/traitar/pfamget/main.nf Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
@Joon-Klaps
Copy link
Copy Markdown
Contributor

Took the liberty to modify it myself, Awesome work.

@brovolia
Copy link
Copy Markdown
Contributor Author

Yey! Thank you! You wrote me about .precommit-config.yaml, but I overlooked this file. Is there any documentation about it? I haven't touched these settings, so I have no idea, why there would be some changes.
So, can I merge the branch?

@Joon-Klaps
Copy link
Copy Markdown
Contributor

YUP go ahead and merge, you deserve it!

There aren't any specific docs on not editing precommit.config.yaml. Generally, within a pull request, we focus on a single topic (e.g., creating a new module). We don't want to edit anything else.

I'm guessing if you didn't, an AI agent did.

@brovolia brovolia added this pull request to the merge queue Feb 11, 2026
Merged via the queue into master with commit 71ad2f5 Feb 11, 2026
32 checks passed
@brovolia brovolia deleted the 9575-new-module-traitar3 branch February 11, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new module: traitar3

3 participants