-
Notifications
You must be signed in to change notification settings - Fork 4
First version of pridepy download module #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e3bf10f
feat(pridepy): add pridepy download module
Shen-YuFei 0fd0a19
Update modules/bigbio/pridepy/main.nf
ypriverol 50df9f4
fix(pridepy): address copilot review feedback
Shen-YuFei 7328506
fix(pridepy): cd into output dir and quote stub paths
Shen-YuFei 8cd0e28
Merge pull request #30 from Shen-YuFei/dev
ypriverol 2694907
fix(pridepy): drop output/ subdir, write to workDir
Shen-YuFei 49e1cc6
Merge pull request #33 from Shen-YuFei/dev
ypriverol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ?: '' } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stub test does not validate the
download_diroutput contract.Line 25 only checks
versions. Sincemodules/bigbio/pridepy/main.nf(Line 15) also emitsdownload_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
🤖 Prompt for AI Agents