-
Notifications
You must be signed in to change notification settings - Fork 51
using the bigbio onsite module #630
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
Changes from all commits
cc3f895
928a835
d262ece
e69769c
cd6cd05
a379a92
0f9b061
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| name: onsite | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| - defaults | ||
| dependencies: | ||
| - bioconda::pyonsite=0.0.2 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,126 @@ | ||||||||||||||||||||||||
| process ONSITE { | ||||||||||||||||||||||||
| tag "$meta.mzml_id" | ||||||||||||||||||||||||
| label 'process_medium' | ||||||||||||||||||||||||
| label 'onsite' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||||||||||||||||||||||||
| 'https://depot.galaxyproject.org/singularity/pyonsite:0.0.2--pyhdfd78af_0' : | ||||||||||||||||||||||||
| 'quay.io/biocontainers/pyonsite:0.0.2--pyhdfd78af_0' }" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| input: | ||||||||||||||||||||||||
| tuple val(meta), path(mzml_file), path(id_file) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| output: | ||||||||||||||||||||||||
| tuple val(meta), path("${id_file.baseName}_*.idXML"), emit: ptm_in_id_onsite | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| tuple val(meta), path("${id_file.baseName}_*.idXML"), emit: ptm_in_id_onsite | |
| tuple val(meta), path("${id_file.baseName}_${params.onsite_algorithm ?: 'lucxor'}.idXML"), emit: ptm_in_id_onsite |
Copilot
AI
Jan 4, 2026
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.
The variable 'args' is defined from task.ext.args but is never used in the command construction. This suggests either the variable should be removed, or it should be incorporated into the algorithm commands to allow external configuration via task.ext.args.
Copilot
AI
Jan 4, 2026
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.
The variable 'prefix' is defined but never used in the script. Consider removing this unused variable or utilizing it in the output file naming if that was the intent.
| def prefix = task.ext.prefix ?: "${meta.mzml_id}" |
Copilot
AI
Jan 4, 2026
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.
The default fragment_tolerance has changed from 0.5 in the old code to '0.05' (as a string) in the new code. This is a significant change in default value (10x smaller) that could affect results. Verify this change is intentional, and consider if the default should remain 0.5, or document why the stricter tolerance of 0.05 is now preferred.
| def fragment_tolerance = params.onsite_fragment_tolerance ?: '0.05' | |
| def fragment_tolerance = params.onsite_fragment_tolerance ?: '0.5' |
Copilot
AI
Jan 4, 2026
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.
The ONSITE process builds the onsite CLI command by interpolating multiple params.* values (e.g. params.onsite_target_modifications, params.onsite_neutral_losses, params.onsite_decoy_mass, params.onsite_decoy_neutral_losses, and other numeric thresholds) directly into a shell string (algorithm_cmd), which is then executed via the script block. If any of these parameters (or derived values like id_file.baseName) contain shell metacharacters (;, &, backticks, $(...), etc.), an attacker who can control pipeline parameters or file names can inject additional commands and gain code execution in the workflow environment when this module is run as part of a multi-tenant service. To mitigate this, ensure all params.* values used in algorithm_cmd are either strictly validated to the expected formats (e.g. numeric ranges or whitelisted tokens) before use, or are passed to the command via safe quoting/escaping or Nextflow’s safer parameter binding mechanisms rather than raw string interpolation into a bash script.
| """ | |
| ${algorithm_cmd} \\ | |
| 2>&1 | tee ${id_file.baseName}_${algorithm}.log | |
| // Sanitize values used in shell redirection/filenames to prevent command injection | |
| def safeAlgorithm = (algorithm =~ /[^A-Za-z0-9_-]/).replaceAll('_') | |
| def safeBaseName = (id_file.baseName =~ /[^A-Za-z0-9._-]/).replaceAll('_') | |
| def log_file = "${safeBaseName}_${safeAlgorithm}.log" | |
| """ | |
| ${algorithm_cmd} \\ | |
| 2>&1 | tee '${log_file}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: onsite | ||
| description: Post-translational modification (PTM) localization using onsite algorithms (AScore, PhosphoRS, LucXor) | ||
| keywords: | ||
| - onsite | ||
| - PTM | ||
| - phosphorylation | ||
| - AScore | ||
| - PhosphoRS | ||
| - LucXor | ||
| - modification | ||
| - localization | ||
| tools: | ||
| - onsite: | ||
| description: | | ||
| Comprehensive Python package for mass spectrometry post-translational modification (PTM) localization. | ||
| Provides algorithms for confident phosphorylation site localization and scoring, including | ||
| implementations of AScore, PhosphoRS, and LucXor (LuciPHOr2). | ||
| homepage: https://github.com/bigbio/onsite | ||
| documentation: https://github.com/bigbio/onsite/blob/main/README.md | ||
| tool_dev_url: https://github.com/bigbio/onsite | ||
| doi: "" | ||
| licence: ["MIT"] | ||
| input: | ||
| - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', mzml_id:'sample1' ] | ||
| - mzml_file: | ||
| type: file | ||
| description: Input spectrum file in mzML format | ||
| pattern: "*.mzML" | ||
| - id_file: | ||
| type: file | ||
| description: Protein/peptide identifications file in idXML format | ||
| pattern: "*.idXML" | ||
| - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', mzml_id:'sample1' ] | ||
| - ptm_in_id_onsite: | ||
| type: file | ||
| description: Protein/peptide identifications file with PTM localization scores | ||
| pattern: "*_{ascore,phosphors,lucxor}.idXML" | ||
| - log: | ||
| type: file | ||
| description: Log file from onsite execution | ||
| pattern: "*.log" | ||
| - versions: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
|
Comment on lines
+37
to
+53
|
||
| authors: | ||
| - "@ypriverol" | ||
| - "@weizhongchun" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process ONSITE" | ||
| script "../main.nf" | ||
| process "ONSITE" | ||
| tag "modules" | ||
| tag "modules_onsite" | ||
| tag "onsite" | ||
|
|
||
| test("Should run AScore algorithm") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id: 'test', mzml_id: 'test_sample' ], | ||
| file(params.test_data['proteomics']['onsite']['mzml'], checkIfExists: true), | ||
| file(params.test_data['proteomics']['onsite']['idxml'], checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| params { | ||
| onsite_algorithm = 'ascore' | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(process.out.versions).match("versions_ascore") | ||
| assert process.out.ptm_in_id_onsite.size() == 1 | ||
| assert process.out.log.size() == 1 | ||
| // Check output file has correct naming | ||
| assert process.out.ptm_in_id_onsite[0][1].toString().endsWith('_ascore.idXML') | ||
| } | ||
| } | ||
|
|
||
| test("Should run PhosphoRS algorithm") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id: 'test', mzml_id: 'test_sample' ], | ||
| file(params.test_data['proteomics']['onsite']['mzml'], checkIfExists: true), | ||
| file(params.test_data['proteomics']['onsite']['idxml'], checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| params { | ||
| onsite_algorithm = 'phosphors' | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(process.out.versions).match("versions_phosphors") | ||
| assert process.out.ptm_in_id_onsite.size() == 1 | ||
| assert process.out.log.size() == 1 | ||
| // Check output file has correct naming | ||
| assert process.out.ptm_in_id_onsite[0][1].toString().endsWith('_phosphors.idXML') | ||
| } | ||
| } | ||
|
|
||
| test("Should run LucXor algorithm") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id: 'test', mzml_id: 'test_sample' ], | ||
| file(params.test_data['proteomics']['onsite']['mzml'], checkIfExists: true), | ||
| file(params.test_data['proteomics']['onsite']['idxml'], checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| params { | ||
| onsite_algorithm = 'lucxor' | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(process.out.versions).match("versions_lucxor") | ||
| assert process.out.ptm_in_id_onsite.size() == 1 | ||
| assert process.out.log.size() == 1 | ||
| // Check output file has correct naming | ||
| assert process.out.ptm_in_id_onsite[0][1].toString().endsWith('_lucxor.idXML') | ||
| } | ||
| } | ||
|
|
||
| test("Should run stub mode") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id: 'test', mzml_id: 'test_sample' ], | ||
| file(params.test_data['proteomics']['onsite']['mzml'], checkIfExists: true), | ||
| file(params.test_data['proteomics']['onsite']['idxml'], checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assert snapshot(process.out.versions).match("versions_stub") | ||
| } | ||
| } | ||
|
Comment on lines
+91
to
+111
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| process { | ||
| publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.