Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3a0cf8c
Add module for trident fetch.
TCLamnidis Nov 7, 2025
5634930
remove prefetched test. update snapshot.
TCLamnidis Nov 7, 2025
90b7416
readd test as comment
TCLamnidis Nov 7, 2025
1501ff5
update trident fetch module and tests
TCLamnidis Nov 10, 2025
0e0e93f
update meta.yml
TCLamnidis Nov 10, 2025
7426d5d
tweak output regex
TCLamnidis Nov 10, 2025
fb4cd38
tweak meta
TCLamnidis Nov 10, 2025
9a25fa3
attempt to fix linting
TCLamnidis Nov 10, 2025
db4218b
Add ontologies for outputs
TCLamnidis Mar 2, 2026
5ef79f7
add input values to tag
TCLamnidis Mar 2, 2026
ccf028c
add fetchFile test
TCLamnidis Mar 2, 2026
b66ab59
add existing package fetchfile test
TCLamnidis Mar 2, 2026
bae2efb
swap to version topics
TCLamnidis Mar 2, 2026
7ffaef0
one output channel per output file type
TCLamnidis Mar 2, 2026
d4f10c8
update snapshot
TCLamnidis Mar 3, 2026
bebf7ef
Apply suggestion from @SPPearce
SPPearce Jul 17, 2026
1b78b4d
Apply batched suggestions from code review
TCLamnidis Sep 15, 2026
4d535d1
update trident version
TCLamnidis Sep 15, 2026
ba9a572
update fetch snapshot
TCLamnidis Sep 15, 2026
a4949b5
sanitize fetch snapshot
TCLamnidis Sep 15, 2026
7d79c90
update snapshot
TCLamnidis Sep 15, 2026
0978cbd
use trident 2.2.2.1
TCLamnidis Sep 15, 2026
0cbe9b7
Merge branch 'master' into trident
SPPearce Sep 16, 2026
d4c3128
reorder output channels
TCLamnidis Sep 16, 2026
d434aa6
restructure fetch output so it outputs one channel with the archive, …
TCLamnidis Sep 23, 2026
92f0f24
update trident fetch tests
TCLamnidis Sep 23, 2026
b2e3729
update meta.yml
TCLamnidis Sep 23, 2026
ac7b219
Merge branch 'master' into trident
TCLamnidis Sep 23, 2026
cc87e3b
Initial commit of trident_valdiate module
TCLamnidis Oct 6, 2026
031d627
Merge remote-tracking branch 'origin' into trident_validate
TCLamnidis Oct 12, 2026
85826f1
Merge branch 'nf-core:master' into trident_validate
TCLamnidis Nov 3, 2026
d87eefb
emit exit status with meta, like in samtools quickcheck
TCLamnidis Nov 3, 2026
aa5e813
remove TODO
TCLamnidis Nov 3, 2026
cf020f5
update meta.yml
TCLamnidis Nov 3, 2026
c9e3705
include input package in output
TCLamnidis Nov 3, 2026
6caf127
minor changes
TCLamnidis Nov 3, 2026
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
7 changes: 7 additions & 0 deletions modules/nf-core/trident/validate/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::poseidon-trident=2.2.2.1"
37 changes: 37 additions & 0 deletions modules/nf-core/trident/validate/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process TRIDENT_VALIDATE {
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/poseidon-trident:2.2.2.1--hf7d7819_0'
: 'quay.io/biocontainers/poseidon-trident:2.2.2.1--hf7d7819_0'}"

input:
// Inputs need to be synchronised so that all files for a given package are provided together.
tuple val(meta), path(input_package)

output:
tuple val(meta), path(input_package), env("EXIT_CODE"), emit: validated_packages
tuple val("${task.process}"), val('trident'), eval('trident --version'), emit: versions_trident, topic: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
"""
trident validate \
-d . \
${args} || EXIT_CODE=\$?

EXIT_CODE=\${EXIT_CODE:-0}
"""

stub:
def args = task.ext.args ?: ''
"""
EXIT_CODE=0
echo trident validate -d . ${args}
"""
}
66 changes: 66 additions & 0 deletions modules/nf-core/trident/validate/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "trident_validate"
description: Check Poseidon packages or package components for structural correctness
keywords:
- poseidon-trident
- poseidon
- trident
- validate
tools:
- "trident":
description: "A tool (trident) to work with modular genotype databases formatted using Poseidon."
homepage: "https://www.poseidon-adna.org/"
documentation: "https://www.poseidon-adna.org/#/trident?id=validate-command"
tool_dev_url: "https://github.com/poseidon-framework/poseidon-hs/"
doi: "10.7554/eLife.98317.1"
licence:
- "MIT"
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', version: "2.1.0", snpSet: "1240K", format:'EIGENSTRAT' ]
- input_package:
type: directory
description: Path to the directory containing the Poseidon package(s) to be validated.
output:
validated_packages:
- - meta:
type: map
description: The meta information of the input package.
- input_package:
type: directory
description: Path to the directory containing the Poseidon package(s) that was validated.
- EXIT_CODE:
type: string
description: Exit code (0 for success, non-zero otherwise) that is the result of the validation check.
ontologies: []
versions_trident:
- - ${task.process}:
type: string
description: The name of the process
- trident:
type: string
description: The name of the tool
- trident --version:
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- trident:
type: string
description: The name of the tool
- trident --version:
type: eval
description: The expression to obtain the version of the tool

authors:
- "@TCLamnidis"
maintainers:
- "@TCLamnidis"
103 changes: 103 additions & 0 deletions modules/nf-core/trident/validate/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
nextflow_process {

name "Test Process TRIDENT_VALIDATE"
script "../main.nf"
process "TRIDENT_VALIDATE"

tag "modules"
tag "modules_nfcore"
tag "trident"
tag "trident/fetch"
tag "trident/validate"

test('Validate 2012_MeyerScience-2.1.1 & 2018_Lamnidis_Fennoscandia-2.1.1') {

setup {
run("TRIDENT_FETCH") {
script "../../fetch/main.nf"
process {
"""
input[0] = channel.fromList([
tuple(
[], // archive_dir
'*2012_MeyerScience-2.1.1*,*2018_Lamnidis_Fennoscandia-2.1.1*', // fetchString
[], // fetchFile
)
])
"""
}
}
}

when {
process {
"""
input[0] = TRIDENT_FETCH.out.downloaded_packages
.flatMap()
.map{
fn ->
def parts = fn.name.split(/-(?=\\d+\\.)/, 2)
def id = parts[0]
def version = parts.size() > 1 ? parts[1] : ''
[[id: id, version: version], fn]
}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

test('Validate 2012_MeyerScience-2.1.1 - stub') {

options "-stub"

setup {
run("TRIDENT_FETCH") {
script "../../fetch/main.nf"
process {
"""
input[0] = channel.fromList([
tuple(
[], // archive_dir
'*2012_MeyerScience-2.1.1*', // fetchString
[], // fetchFile
)
])
"""
}
}
}

when {
process {
"""
input[0] = TRIDENT_FETCH.out.downloaded_packages
.flatMap()
.map{
fn ->
def parts = fn.name.split(/-(?=\\d+\\.)/, 2)
def id = parts[0]
def version = parts.size() > 1 ? parts[1] : ''
[[id: id, version: version], fn]
}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

}
92 changes: 92 additions & 0 deletions modules/nf-core/trident/validate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"Validate 2012_MeyerScience-2.1.1 - stub": {
"content": [
{
"validated_packages": [
[
{
"id": "dummy_package_dir"
},
[
"POSEIDON.yml:md5,d41d8cd98f00b204e9800998ecf8427e",
"dummy_package.geno:md5,d41d8cd98f00b204e9800998ecf8427e",
"dummy_package.ind:md5,d41d8cd98f00b204e9800998ecf8427e",
"dummy_package.janno:md5,d41d8cd98f00b204e9800998ecf8427e",
"dummy_package.snp:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"0"
]
],
"versions_trident": [
[
"TRIDENT_VALIDATE",
"trident",
"2.2.2.1"
]
]
}
],
"timestamp": "2026-11-03T14:43:12.379249",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.10.4"
}
},
"Validate 2012_MeyerScience-2.1.1 & 2018_Lamnidis_Fennoscandia-2.1.1": {
"content": [
{
"validated_packages": [
[
{
"id": "2012_MeyerScience",
"version": "2.1.1"
},
[
"2012_MeyerScience.bed:md5,781fbf7f4573cd286133457690b0ddb3",
"2012_MeyerScience.bib:md5,db334a66b02319ec8dd100bfdd9dc725",
"2012_MeyerScience.bim:md5,1fa4fd6b43fdf93bdda133d42d56f78d",
"2012_MeyerScience.fam:md5,0c6a50cb207e46e01d89a295ee6ab91e",
"2012_MeyerScience.janno:md5,e6d97237e0c1a450614637a7a37a58ef",
"CHANGELOG.md:md5,12369b9ea26f7e2a3b7a119ad729bc59",
"POSEIDON.yml:md5,cfdaca8ddb5ee14bc8d8baeb8b8c5622"
],
"0"
],
[
{
"id": "2018_Lamnidis_Fennoscandia",
"version": "2.1.1"
},
[
"2018_Lamnidis_Fennoscandia.bed:md5,74d8d52d45a0d2f6ed1212af5d2f4268",
"2018_Lamnidis_Fennoscandia.bib:md5,4c5ee1f871c1096a6c75101a08448377",
"2018_Lamnidis_Fennoscandia.bim:md5,10fe736b07171086524ec92dc5e06a22",
"2018_Lamnidis_Fennoscandia.fam:md5,90c1b106d15bceccc1e25c34d3060d75",
"2018_Lamnidis_Fennoscandia.janno:md5,26aefa65ac7ce4c070503cde7f7a1297",
"CHANGELOG.txt:md5,3d4d9c8c1c4395d086445193f29c380f",
"POSEIDON.yml:md5,85f148be29824c8f9136cd4cb12d4462"
],
"0"
]
],
"versions_trident": [
[
"TRIDENT_VALIDATE",
"trident",
"2.2.2.1"
],
[
"TRIDENT_VALIDATE",
"trident",
"2.2.2.1"
]
]
}
],
"timestamp": "2026-11-03T14:43:00.252986",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.10.4"
}
}
}
Loading