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
17 changes: 8 additions & 9 deletions modules/bigbio/pridepy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ process PRIDEPY_DOWNLOAD {
val(meta)

output:
tuple val(meta), path("output/"), emit: download_dir
path "versions.yml", emit: versions
tuple val(meta), path("*.{raw,mzML,mzML.gz,mgf,d.tar,d.tar.gz,d.zip,dia,wiff,wiff.scan}"), emit: spectra, optional: true
tuple val(meta), path("*-checksum.tsv"), emit: checksums, optional: true
path "versions.yml", emit: versions

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

script:
def args = task.ext.args ?: ''
"""
mkdir -p output
(
cd output
pridepy ${args}
)
pridepy ${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -34,9 +31,11 @@ process PRIDEPY_DOWNLOAD {
"""

stub:
def args = task.ext.args ?: ''
def checksum_touch = args.contains('--checksum-check') ? "touch \"${meta.id}-checksum.tsv\"" : ''
"""
mkdir -p output
touch "output/${meta.id}.placeholder"
touch "${meta.id}.raw"
${checksum_touch}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
23 changes: 18 additions & 5 deletions modules/bigbio/pridepy/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,28 @@ input:
Groovy Map containing task information.
e.g. `[ id: 'PXD001819' ]`
output:
download_dir:
spectra:
- - meta:
type: map
description: |
Groovy Map containing task information forwarded from input.
- "output/":
type: directory
description: Directory containing downloaded files (for download sub-commands)
pattern: "output/"
- "*.{raw,mzML,mzML.gz,mgf,d.tar,d.tar.gz,d.zip,dia,wiff,wiff.scan}":
type: file
description: |
Mass spectrometry spectra files downloaded from PRIDE Archive
(Thermo .raw, mzML, Bruker .d archives, DIA-NN .dia, Sciex .wiff, etc.).
Emitted to the task workDir; downstream pipelines pick specific files
via publishDir / saveAs in their modules.config.
pattern: "*.{raw,mzML,mzML.gz,mgf,d.tar,d.tar.gz,d.zip,dia,wiff,wiff.scan}"
checksums:
- - meta:
type: map
description: |
Groovy Map containing task information forwarded from input.
- "*-checksum.tsv":
type: file
description: SHA1 checksums file generated by pridepy when --checksum-check is enabled.
pattern: "*-checksum.tsv"
versions:
- versions.yml:
type: file
Expand Down
37 changes: 35 additions & 2 deletions modules/bigbio/pridepy/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nextflow_process {
tag "modules_pridepy"
tag "pridepy"

test("Should run stub mode") {
test("Should run stub mode (no checksum)") {

options "-stub"

Expand All @@ -22,7 +22,40 @@ nextflow_process {

then {
assert process.success
assert snapshot(process.out.versions).match("versions_stub")
assert process.out.spectra.size() == 1
assert process.out.checksums.size() == 0
assert snapshot(
process.out.spectra,
process.out.versions
).match("stub_no_checksum")
}
}

test("Should run stub mode with --checksum-check") {

options "-stub"

when {
process {
"""
input[0] = [ id: 'PXD001819' ]
"""
}
params {
module_args = '--checksum-check'
}
config "./nextflow.config"
}

then {
assert process.success
assert process.out.spectra.size() == 1
assert process.out.checksums.size() == 1
assert snapshot(
process.out.spectra,
process.out.checksums,
process.out.versions
).match("stub_with_checksum")
}
}
}
40 changes: 38 additions & 2 deletions modules/bigbio/pridepy/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
{
"versions_stub": {
"stub_no_checksum": {
"content": [
[
[
{
"id": "PXD001819"
},
"PXD001819.raw:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
"versions.yml:md5,c27ccb04c91f92f188b7f4cf2d54ed49"
]
],
"timestamp": "2026-04-28T18:15:37.876014654",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"stub_with_checksum": {
"content": [
[
[
{
"id": "PXD001819"
},
"PXD001819.raw:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
[
{
"id": "PXD001819"
},
"PXD001819-checksum.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
"versions.yml:md5,c27ccb04c91f92f188b7f4cf2d54ed49"
]
],
"timestamp": "2026-04-28T14:06:27.317530521",
"timestamp": "2026-04-28T18:15:43.996367071",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
Expand Down
4 changes: 4 additions & 0 deletions modules/bigbio/pridepy/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: 'PRIDEPY_DOWNLOAD' {
ext.args = { params.module_args ?: '' }
}
}
Loading