-
Notifications
You must be signed in to change notification settings - Fork 1k
Add module to fetch SDRF files from PRIDE Archive #11513
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
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
34a1114
feat(pridepy/fetchsdrf): add module to fetch SDRF files from PRIDE Ar…
jonasscheid fd7d93b
fix(pridepy/fetchsdrf): use importlib.metadata for version capture in…
jonasscheid ec4d75f
fix(pridepy/fetchsdrf): sync meta.yml version eval with main.nf
jonasscheid f5f5bda
[automated] Fix code linting
nf-core-bot 8f45868
review(pridepy/fetchsdrf): apply harshil alignment and use sanitizeOu…
jonasscheid 132fd5f
Merge branch 'master' into pridepy-fetch-sdrf
jonasscheid af2dc2d
fix(pridepy/fetchsdrf): drop integer-indexed keys from snapshot for s…
jonasscheid 2bc78db
Merge remote-tracking branch 'upstream/master' into pridepy-fetch-sdrf
jonasscheid 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,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - "bioconda::pridepy=0.0.15" |
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,47 @@ | ||
| process PRIDEPY_FETCHSDRF { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/pridepy:0.0.15--pyhdfd78af_0': | ||
| 'quay.io/biocontainers/pridepy:0.0.15--pyhdfd78af_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), val(pride_id) | ||
|
|
||
| output: | ||
| tuple val(meta), path("${prefix}.sdrf.tsv"), emit: sdrf | ||
| tuple val("${task.process}"), val('pridepy'), eval('python -c "from importlib.metadata import version; print(version(\'pridepy\'))"'), topic: versions, emit: versions_pridepy | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| pridepy stream-files-metadata \\ | ||
| -a "${pride_id}" \\ | ||
| -o files_metadata.json \\ | ||
| $args | ||
|
|
||
| # Check if SDRF is present in metadata and extract | ||
| sdrf_name=\$(awk -F'"' '/"fileName" *: *"(sdrf\\.tsv|[^"]+\\.sdrf\\.tsv)"/ {print \$4; exit}' files_metadata.json) | ||
| [ -n "\$sdrf_name" ] || { echo "ERROR: No SDRF file found for ${pride_id}" >&2; exit 1; } | ||
|
|
||
| pridepy download-file-by-name \\ | ||
| -a "${pride_id}" \\ | ||
| -f "\$sdrf_name" \\ | ||
| -o . \\ | ||
| $args | ||
|
|
||
| mv "\$sdrf_name" "${prefix}.sdrf.tsv" | ||
| """ | ||
|
|
||
| stub: | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}.sdrf.tsv | ||
| """ | ||
| } | ||
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,68 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "pridepy_fetchsdrf" | ||
| description: Fetch an SDRF file from the PRIDE Archive for a given project accession. | ||
| keywords: | ||
| - pride | ||
| - sdrf | ||
| - proteomics | ||
| - download | ||
| - metadata | ||
| tools: | ||
| - "pridepy": | ||
| description: | | ||
| Python client library to access PRIDE Archive data programmatically, | ||
| including downloading files and metadata for public proteomics datasets. | ||
| 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 sample information | ||
| e.g. `[ id:'PXD004684' ]` | ||
| - pride_id: | ||
| type: string | ||
| description: PRIDE Archive project accession (e.g. PXD004684) | ||
|
|
||
| output: | ||
| sdrf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'PXD004684' ]` | ||
| - "${prefix}.sdrf.tsv": | ||
| type: file | ||
| description: SDRF (Sample and Data Relationship Format) file describing the experimental design of the PRIDE project | ||
| pattern: "*.sdrf.tsv" | ||
| versions_pridepy: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - pridepy: | ||
| type: string | ||
| description: The tool name | ||
| - 'python -c "from importlib.metadata import version; print(version(''pridepy''))"': | ||
| type: string | ||
| description: The command used to generate the version of the tool | ||
|
|
||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - pridepy: | ||
| type: string | ||
| description: The tool name | ||
| - 'python -c "from importlib.metadata import version; print(version(''pridepy''))"': | ||
| type: string | ||
| description: The command used to generate the version of the tool | ||
|
|
||
| authors: | ||
| - "@jonasscheid" | ||
| maintainers: | ||
| - "@jonasscheid" |
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,59 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PRIDEPY_FETCHSDRF" | ||
| script "../main.nf" | ||
| process "PRIDEPY_FETCHSDRF" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "pridepy" | ||
| tag "pridepy/fetchsdrf" | ||
|
|
||
| test("pride - PXD004684") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'PXD004684' ], | ||
| 'PXD004684' | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert path(process.out.sdrf[0][1]).text.contains('Source Name') }, | ||
| { assert snapshot(process.out).match() } | ||
|
jonasscheid marked this conversation as resolved.
Outdated
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("pride - PXD004684 - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'PXD004684' ], | ||
| 'PXD004684' | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
|
jonasscheid marked this conversation as resolved.
Outdated
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
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,84 @@ | ||
| { | ||
| "pride - PXD004684 - stub": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "PXD004684" | ||
| }, | ||
| "PXD004684.sdrf.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "1": [ | ||
| [ | ||
| "PRIDEPY_FETCHSDRF", | ||
| "pridepy", | ||
| "0.0.15" | ||
| ] | ||
| ], | ||
| "sdrf": [ | ||
| [ | ||
| { | ||
| "id": "PXD004684" | ||
| }, | ||
| "PXD004684.sdrf.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "versions_pridepy": [ | ||
| [ | ||
| "PRIDEPY_FETCHSDRF", | ||
| "pridepy", | ||
| "0.0.15" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-04T07:51:07.096175717", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.10.4" | ||
| } | ||
| }, | ||
| "pride - PXD004684": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "PXD004684" | ||
| }, | ||
| "PXD004684.sdrf.tsv:md5,a8a2aa91d85adb241110fe3a7ce8f372" | ||
| ] | ||
| ], | ||
| "1": [ | ||
| [ | ||
| "PRIDEPY_FETCHSDRF", | ||
| "pridepy", | ||
| "0.0.15" | ||
| ] | ||
| ], | ||
| "sdrf": [ | ||
| [ | ||
| { | ||
| "id": "PXD004684" | ||
| }, | ||
| "PXD004684.sdrf.tsv:md5,a8a2aa91d85adb241110fe3a7ce8f372" | ||
| ] | ||
| ], | ||
| "versions_pridepy": [ | ||
| [ | ||
| "PRIDEPY_FETCHSDRF", | ||
| "pridepy", | ||
| "0.0.15" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-04T07:50:51.643144802", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.10.4" | ||
| } | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.