Conversation
There was a problem hiding this comment.
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.
|
Hi @rpetit3 could you please review the module? :) |
Joon-Klaps
left a comment
There was a problem hiding this comment.
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.
890405a to
a9d7474
Compare
Joon-Klaps
left a comment
There was a problem hiding this comment.
Still a couple of stuff that needs double checking
| "gene_prediction": [ | ||
|
|
||
| ], | ||
| "pfam_annotation": [ | ||
|
|
||
| ], |
There was a problem hiding this comment.
I'm not familar with traitar, is there an easy way to have output files for these variables, by adding more tests?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
| # Download PFAM data for traitar annotation | ||
| traitar pfam pfam_data |
There was a problem hiding this comment.
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)
e6d796e to
12946f6
Compare
12946f6 to
273be60
Compare
| "versions": { | ||
| "content": [ | ||
| null, | ||
| null | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.0" | ||
| }, | ||
| "timestamp": "2026-01-29T09:38:08.995821451" | ||
| }, |
There was a problem hiding this comment.
Think this is an artifcat of previous tests?
| "versions": { | |
| "content": [ | |
| null, | |
| null | |
| ], | |
| "meta": { | |
| "nf-test": "0.9.3", | |
| "nextflow": "25.10.0" | |
| }, | |
| "timestamp": "2026-01-29T09:38:08.995821451" | |
| }, |
There was a problem hiding this comment.
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.
| - pfam_db: | ||
| type: directory | ||
| description: | | ||
| PFAM database directory created by traitar/pfamget module |
There was a problem hiding this comment.
| 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/ |
|
I see in your commit history, the classic fight with linters & prettier is happening. Have a read here how to set it up. |
273be60 to
7ca2f90
Compare
|
Took the liberty to modify it myself, Awesome work. |
|
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. |
|
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. |
This module runs Traitar3 in phenotype mode to infer phenotype profiles from assembled nucleotide FASTA files, producing tabular trait prediction results per sample.