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
6 changes: 6 additions & 0 deletions modules/bigbio/pridepy/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::pridepy=0.0.14
45 changes: 45 additions & 0 deletions modules/bigbio/pridepy/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process PRIDEPY_DOWNLOAD {
tag "${meta.id}"
label 'process_low'
label 'process_long'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/pridepy:0.0.14--pyhdfd78af_0'
: 'biocontainers/pridepy:0.0.14--pyhdfd78af_0'}"

input:
val(meta)

output:
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 ?: ''
"""
pridepy ${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
pridepy: \$(python -c "from importlib.metadata import version; print(version('pridepy'))" || echo "unknown")
END_VERSIONS
"""

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

cat <<-END_VERSIONS > versions.yml
"${task.process}":
pridepy: 0.0.14
END_VERSIONS
"""
}
62 changes: 62 additions & 0 deletions modules/bigbio/pridepy/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: pridepy
description: Python client for PRIDE Archive — download and query proteomics datasets
keywords:
- pride
- download
- proteomics
- raw files
- globus
- aspera
tools:
- pridepy:
description: |
pridepy is a Python client for the PRIDE Archive REST API.
It supports downloading public/private files via FTP, Aspera, Globus (HTTPS), or S3,
as well as querying project metadata and file listings.
The specific sub-command and arguments are passed via task.ext.args.
homepage: https://github.com/PRIDE-Archive/pridepy
documentation: https://github.com/PRIDE-Archive/pridepy
tool_dev_url: https://github.com/PRIDE-Archive/pridepy
licence:
- "Apache-2.0"
identifier: ""
input:
- meta:
type: map
description: |
Groovy Map containing task information.
e.g. `[ id: 'PXD001819' ]`
output:
spectra:
- - meta:
type: map
description: |
Groovy Map containing task information forwarded from input.
- "*.{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
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750
authors:
- "@ypriverol"
maintainers:
- "@ypriverol"
61 changes: 61 additions & 0 deletions modules/bigbio/pridepy/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
nextflow_process {

name "Test Process PRIDEPY_DOWNLOAD"
script "../main.nf"
process "PRIDEPY_DOWNLOAD"
tag "modules"
tag "modules_bigbio"
tag "modules_pridepy"
tag "pridepy"

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

options "-stub"

when {
process {
"""
input[0] = [ id: 'PXD001819' ]
"""
}
}

then {
assert process.success
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")
}
Comment on lines +23 to +59
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Stub test does not validate the download_dir output contract.

Line 25 only checks versions. Since modules/bigbio/pridepy/main.nf (Line 15) also emits download_dir, regressions there can pass unnoticed.

Suggested assertion addition
         then {
             assert process.success
+            assert snapshot(process.out.download_dir).match("download_dir_stub")
             assert snapshot(process.out.versions).match("versions_stub")
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
then {
assert process.success
assert snapshot(process.out.versions).match("versions_stub")
}
then {
assert process.success
assert snapshot(process.out.download_dir).match("download_dir_stub")
assert snapshot(process.out.versions).match("versions_stub")
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@modules/bigbio/pridepy/tests/main.nf.test` around lines 23 - 26, The test
currently only asserts process.out.versions; add an assertion that validates the
emitted download_dir output from the workflow (e.g., assert
snapshot(process.out.download_dir).match("download_dir_stub") or an equivalent
existence/structure check) so regressions to the download_dir output from
modules/bigbio/pridepy/main.nf are caught; update the test block that references
process and snapshot to include this download_dir assertion alongside the
existing versions assertion.

}
}
50 changes: 50 additions & 0 deletions modules/bigbio/pridepy/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"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-28T18:15:43.996367071",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
}
}
7 changes: 7 additions & 0 deletions modules/bigbio/pridepy/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

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