Skip to content
Draft
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
14 changes: 1 addition & 13 deletions modules/nf-core/poolsnp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ process POOLSNP {
tuple val(meta), path("*.vcf.gz") , emit: vcf
tuple val(meta), path("*cov-*.txt"), emit: max_cov , optional: true
tuple val(meta), path("*BS.txt.gz"), emit: bad_sites, optional: true
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('poolsnp'), val('1.0.1'), emit: versions_poolsnp, topic: versions // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.0.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
assert (!max_cov && max_cov_file) || (max_cov && !max_cov_file)

"""
Expand All @@ -36,27 +35,16 @@ process POOLSNP {
jobs=${task.cpus} \\
max-cov=${max_cov ? "${max_cov}" : "\$PWD/${max_cov_file}"} \\
$args

cat <<-END_VERSIONS > versions.yml
${task.process}:
poolsnp: "${VERSION}"
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.0.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

"""
echo "##fileformat=VCFv4.2" > ${prefix}.vcf
echo "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO" >> ${prefix}.vcf
gzip ${prefix}.vcf
${max_cov ? "touch ${prefix}_cov-${max_cov}.txt" : ""}
echo "" | gzip > ${prefix}_BS.txt.gz

cat <<-END_VERSIONS > versions.yml
${task.process}:
poolsnp: "${VERSION}"
END_VERSIONS
"""
}
48 changes: 32 additions & 16 deletions modules/nf-core/poolsnp/meta.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "poolsnp"
description: PoolSNP is a heuristic SNP caller, which uses an MPILEUP file and a reference
genome in FASTA format as inputs.
description: PoolSNP is a heuristic SNP caller, which uses an MPILEUP file and a
reference genome in FASTA format as inputs.
keywords:
- poolseq
- mpileup
Expand All @@ -12,7 +11,8 @@ tools:
a reference genome in FASTA format as inputs."
homepage: "https://github.com/capoony/PoolSNP"
documentation: "https://github.com/capoony/PoolSNP/blob/master/README.md"
licence: ["Apache-2.0"]
licence:
- "Apache-2.0"
args_id: "$args"

identifier: ""
Expand Down Expand Up @@ -77,8 +77,8 @@ output:
e.g. `[ id:'sample1', single_end:false ]`
- "*.vcf.gz":
type: file
description: Gzipped VCF file containing allele counts and frequencies for
every position and library
description: Gzipped VCF file containing allele counts and frequencies
for every position and library
pattern: "*.vcf.gz"
ontologies:
- edam: http://edamontology.org/format_3989 # GZIP format
Expand All @@ -90,8 +90,8 @@ output:
e.g. `[ id:'sample1', single_end:false ]`
- "*cov-*.txt":
type: file
description: File containing the maximum coverage thresholds for all chromosomal
arms and libraries
description: File containing the maximum coverage thresholds for all
chromosomal arms and libraries
pattern: "*cov-*.txt"
ontologies: []
bad_sites:
Expand All @@ -102,19 +102,35 @@ output:
e.g. `[ id:'sample1', single_end:false ]`
- "*BS.txt.gz":
type: file
description: File containing a list of sites (variable and invariable) that
did not pass the SNP calling criteria
description: File containing a list of sites (variable and invariable)
that did not pass the SNP calling criteria
pattern: "*BS.txt.gz"
optional: true
ontologies:
- edam: http://edamontology.org/format_3989 # GZIP format
versions_poolsnp:
- - ${task.process}:
type: string
description: The name of the process
- poolsnp:
type: string
description: The name of the tool
- 1.0.1:
type: string
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- poolsnp:
type: string
description: The name of the tool
- 1.0.1:
type: string
description: The expression to obtain the version of the tool

authors:
- "@abhilesh"
maintainers:
Expand Down
21 changes: 8 additions & 13 deletions modules/nf-core/poolsnp/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ nextflow_process {
}

then {
assert process.success
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf[0][1]).vcf.variantsMD5,
process.out.max_cov
sanitizeOutput(process.out, unstableKeys: ['max_cov', 'vcf'])
).match()
}
)
Expand All @@ -82,11 +81,11 @@ nextflow_process {
}

then {
assert process.success
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf[0][1]).vcf.variantsMD5
path(process.out.vcf[0][1]).vcf.variantsMD5,
sanitizeOutput(process.out, unstableKeys: ['max_cov', 'vcf'])
).match()
}
)
Expand Down Expand Up @@ -118,7 +117,7 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
process.out.findAll { key, val -> key.startsWith("versions")},
path(process.out.vcf[0][1]).vcf.variantsMD5,
process.out.max_cov
).match()
Expand Down Expand Up @@ -148,13 +147,9 @@ nextflow_process {
}

then {
assert process.success
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf[0][1]).vcf.variantsMD5
).match()
}
{ assert snapshot(sanitizeOutput(process.out)).match()}
)
}
}
Expand Down
151 changes: 114 additions & 37 deletions modules/nf-core/poolsnp/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"sarscov2 - mpileup - max_cov - stub": {
"content": [
[
"versions.yml:md5,2bc174a10a560499c04e6b35ce86fed0"
],
{
"versions_poolsnp": [
[
"POOLSNP",
"poolsnp",
"1.0.1"
]
]
},
"d41d8cd98f00b204e9800998ecf8427e",
[
[
Expand All @@ -14,57 +20,128 @@
]
]
],
"timestamp": "2026-07-08T05:32:01.870716039",
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.6"
},
"timestamp": "2025-05-12T17:14:40.699184098"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"sarscov2 - mpileup - max_cov_file - stub": {
"content": [
[
"versions.yml:md5,2bc174a10a560499c04e6b35ce86fed0"
],
"d41d8cd98f00b204e9800998ecf8427e"
{
"bad_sites": [
[
{
"id": "test"
},
"test_BS.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"max_cov": [

],
"vcf": [
[
{
"id": "test"
},
"test.vcf.gz:md5,4a36fe59dc6865cd5ee9e7ecd936106e"
]
],
"versions_poolsnp": [
[
"POOLSNP",
"poolsnp",
"1.0.1"
]
]
}
],
"timestamp": "2026-07-10T05:55:27.287972382",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-16T15:56:12.188459"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"sarscov2 - mpileup - max_cov": {
"content": [
[
"versions.yml:md5,2bc174a10a560499c04e6b35ce86fed0"
],
"46e2d27f13d700dbdb061091308f1555",
[
[
{
"id": "test"
},
"test-cov-0.7.txt:md5,ccbb119522c09daa976a9015ba999329"
{
"bad_sites": [
[
{
"id": "test"
},
"test_BS.txt.gz:md5,41251fba6925d7428836739822168bd1"
]
],
"max_cov": [
[
{
"id": "test"
},
"test-cov-0.7.txt"
]
],
"vcf": [
[
{
"id": "test"
},
"test.vcf.gz"
]
],
"versions_poolsnp": [
[
"POOLSNP",
"poolsnp",
"1.0.1"
]
]
]
}
],
"timestamp": "2026-07-10T05:55:07.885346374",
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.6"
},
"timestamp": "2025-05-12T17:14:11.680742"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"sarscov2 - mpileup - max_cov_file": {
"content": [
[
"versions.yml:md5,2bc174a10a560499c04e6b35ce86fed0"
],
"46e2d27f13d700dbdb061091308f1555"
"46e2d27f13d700dbdb061091308f1555",
{
"bad_sites": [
[
{
"id": "test"
},
"test_BS.txt.gz:md5,41251fba6925d7428836739822168bd1"
]
],
"max_cov": [

],
"vcf": [
[
{
"id": "test"
},
"test.vcf.gz"
]
],
"versions_poolsnp": [
[
"POOLSNP",
"poolsnp",
"1.0.1"
]
]
}
],
"timestamp": "2026-07-10T05:55:14.671243804",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-16T15:31:24.140061"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading