From c02f1698d66dc688a807f6e2452b519159cae172 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 14:00:22 +0100 Subject: [PATCH 1/7] :art: fix linting for onsite (still w/o strict syntax) --- modules/bigbio/onsite/environment.yml | 1 - modules/bigbio/onsite/main.nf | 6 ++- modules/bigbio/onsite/meta.yml | 77 +++++++++++++++------------ 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/modules/bigbio/onsite/environment.yml b/modules/bigbio/onsite/environment.yml index f1d5c78..0025aa1 100644 --- a/modules/bigbio/onsite/environment.yml +++ b/modules/bigbio/onsite/environment.yml @@ -1,4 +1,3 @@ -name: onsite channels: - conda-forge - bioconda diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 4101b3e..67d2e09 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -5,7 +5,7 @@ process 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' }" + 'biocontainers/pyonsite:0.0.2--pyhdfd78af_0' }" input: tuple val(meta), path(mzml_file), path(id_file) @@ -15,6 +15,9 @@ process ONSITE { path "versions.yml", emit: versions path "*.log", emit: log + when: + task.ext.when == null || task.ext.when + script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.mzml_id}" @@ -60,6 +63,7 @@ process ONSITE { -out ${id_file.baseName}_phosphors.idXML \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} + ${args} """ } else if (algorithm == 'lucxor') { // LucXor: uses -in, -id, -out, --fragment-error-units (note: error-units not mass-unit) diff --git a/modules/bigbio/onsite/meta.yml b/modules/bigbio/onsite/meta.yml index 62a06aa..0d19d71 100644 --- a/modules/bigbio/onsite/meta.yml +++ b/modules/bigbio/onsite/meta.yml @@ -1,5 +1,6 @@ name: onsite -description: Post-translational modification (PTM) localization using onsite algorithms (AScore, PhosphoRS, LucXor) +description: Post-translational modification (PTM) localization using onsite + algorithms (AScore, PhosphoRS, LucXor) keywords: - onsite - PTM @@ -18,40 +19,50 @@ tools: 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"] + licence: + - "MIT" + identifier: "" 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' ]` + - mzml_file: + type: file + description: Input spectrum file in mzML format + pattern: "*.mzML" + ontologies: [] + - id_file: + type: file + description: Protein/peptide identifications file in idXML format + pattern: "*.idXML" + ontologies: [] output: - - 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" + ptm_in_id_onsite: + - - meta: + type: map + description: | + Groovy Map containing sample information + - ${id_file.baseName}_*.idXML: + type: file + description: idXML file containing PTM localization results from onsite + pattern: "${id_file.baseName}_*.idXML" + ontologies: [] + log: + - "*.log": + type: file + description: Log file from onsite execution + pattern: "*.log" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 authors: - "@ypriverol" - "@weizhongchun" + - "@enryh" From 66baee71ec465fe2409da540db940ecc1e5eb51f Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 14:01:39 +0100 Subject: [PATCH 2/7] :art: add missing tag and exclude test outputs from git --- .gitignore | 2 ++ modules/bigbio/onsite/tests/main.nf.test | 1 + 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 04c2d80..ea0ae1b 100644 --- a/.gitignore +++ b/.gitignore @@ -198,6 +198,8 @@ dag.svg testing/ testing*/ *.pyc +.nf-test +*nf.test.snap # Codacy .codacy diff --git a/modules/bigbio/onsite/tests/main.nf.test b/modules/bigbio/onsite/tests/main.nf.test index 8e45206..8caec60 100644 --- a/modules/bigbio/onsite/tests/main.nf.test +++ b/modules/bigbio/onsite/tests/main.nf.test @@ -5,6 +5,7 @@ nextflow_process { process "ONSITE" tag "modules" tag "modules_onsite" + tag "modules_bigbio" tag "onsite" test("Should run AScore algorithm") { From 42cd4bccf2a427bfe09280d3e3dcc570e9c8c766 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 15:43:54 +0100 Subject: [PATCH 3/7] Updt onsite prefix (#2) * Replaced ".mzml_id" to ".id" * Updated output labels with "prefix" * Updated output to "prefix" --------- Co-authored-by: edircoli --- modules/bigbio/onsite/main.nf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 67d2e09..2f73eb8 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -1,5 +1,5 @@ process ONSITE { - tag "$meta.mzml_id" + tag "$meta.id" label 'process_medium' label 'onsite' @@ -11,7 +11,7 @@ process ONSITE { 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("${task.ext.prefix ?: meta.id}_*.idXML"), emit: ptm_in_id_onsite path "versions.yml", emit: versions path "*.log", emit: log @@ -20,7 +20,7 @@ process ONSITE { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.mzml_id}" + def prefix = task.ext.prefix ?: "${meta.id}" // Algorithm selection: lucxor (default), ascore, or phosphors def algorithm = params.onsite_algorithm ?: 'lucxor' @@ -48,7 +48,7 @@ process ONSITE { onsite ascore \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${id_file.baseName}_ascore.idXML \\ + -out ${prefix}_ascore.idXML \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} """ @@ -60,7 +60,7 @@ process ONSITE { onsite phosphors \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${id_file.baseName}_phosphors.idXML \\ + -out ${prefix}_phosphors.idXML \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} ${args} @@ -90,7 +90,7 @@ process ONSITE { onsite lucxor \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${id_file.baseName}_lucxor.idXML \\ + -out ${prefix}_lucxor.idXML \\ --fragment-method ${fragment_method} \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-error-units ${fragment_unit} \\ @@ -112,11 +112,11 @@ process ONSITE { } """ - ${algorithm_cmd.trim()} 2>&1 | tee ${id_file.baseName}_${algorithm}.log + ${algorithm_cmd.trim()} 2>&1 | tee ${prefix}_${algorithm}.log cat <<-END_VERSIONS > versions.yml "${task.process}": - onsite: \$(onsite --version 2>&1 | grep -oP 'version \\K[0-9.]+' || echo "unknown") + onsite: \$(onsite --version 2>&1 | grep -oE 'version \\K[0-9.]+' || echo "unknown") algorithm: ${algorithm} END_VERSIONS """ From a62b51ea6de55bb26e381b819e3ffd29cbe5c30f Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 15:45:16 +0100 Subject: [PATCH 4/7] :art: make it compatible to the strict syntax --- modules/bigbio/onsite/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 2f73eb8..d040125 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -43,7 +43,7 @@ process ONSITE { if (algorithm == 'ascore') { // AScore: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') algorithm_cmd = """ onsite ascore \\ -in ${mzml_file} \\ @@ -55,7 +55,7 @@ process ONSITE { } else if (algorithm == 'phosphors') { // PhosphoRS: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') algorithm_cmd = """ onsite phosphors \\ -in ${mzml_file} \\ @@ -85,7 +85,7 @@ process ONSITE { def decoy_mass = params.onsite_decoy_mass ? "--decoy-mass ${params.onsite_decoy_mass}" : "--decoy-mass 79.966331" def decoy_losses = params.onsite_decoy_neutral_losses ? "--decoy-neutral-losses ${params.onsite_decoy_neutral_losses}" : "--decoy-neutral-losses 'X -H3PO4 -97.97690'" - def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { it }.join(' \\\n ') + def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') algorithm_cmd = """ onsite lucxor \\ -in ${mzml_file} \\ From 8da69e3006d94f508f7d1f2b529b457c0bde18f5 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 15:55:07 +0100 Subject: [PATCH 5/7] :art: format document --- modules/bigbio/onsite/main.nf | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index d040125..dabf5a0 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -1,11 +1,11 @@ process ONSITE { - tag "$meta.id" + tag "${meta.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' : - 'biocontainers/pyonsite:0.0.2--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/pyonsite:0.0.2--pyhdfd78af_0' + : 'biocontainers/pyonsite:0.0.2--pyhdfd78af_0'}" input: tuple val(meta), path(mzml_file), path(id_file) @@ -43,7 +43,7 @@ process ONSITE { if (algorithm == 'ascore') { // AScore: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') algorithm_cmd = """ onsite ascore \\ -in ${mzml_file} \\ @@ -52,10 +52,11 @@ process ONSITE { --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} """ - } else if (algorithm == 'phosphors') { + } + else if (algorithm == 'phosphors') { // PhosphoRS: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') algorithm_cmd = """ onsite phosphors \\ -in ${mzml_file} \\ @@ -65,7 +66,8 @@ process ONSITE { --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} ${args} """ - } else if (algorithm == 'lucxor') { + } + else if (algorithm == 'lucxor') { // LucXor: uses -in, -id, -out, --fragment-error-units (note: error-units not mass-unit) fragment_unit = params.onsite_fragment_error_units ?: 'Da' def fragment_method = params.onsite_fragment_method ?: 'CID' @@ -85,7 +87,7 @@ process ONSITE { def decoy_mass = params.onsite_decoy_mass ? "--decoy-mass ${params.onsite_decoy_mass}" : "--decoy-mass 79.966331" def decoy_losses = params.onsite_decoy_neutral_losses ? "--decoy-neutral-losses ${params.onsite_decoy_neutral_losses}" : "--decoy-neutral-losses 'X -H3PO4 -97.97690'" - def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll {it -> it }.join(' \\\n ') + def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') algorithm_cmd = """ onsite lucxor \\ -in ${mzml_file} \\ @@ -107,8 +109,9 @@ process ONSITE { --min-num-psms-model ${min_num_psms} \\ --rt-tolerance ${rt_tolerance}${optional_flags ? ' \\\n ' + optional_flags : ''} """ - } else { - error "Unknown onsite algorithm: ${algorithm}. Supported algorithms: ascore, phosphors, lucxor" + } + else { + error("Unknown onsite algorithm: ${algorithm}. Supported algorithms: ascore, phosphors, lucxor") } """ From 94d800b7c3478c13dd3538f8efd0311d37aab168 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 16:51:28 +0100 Subject: [PATCH 6/7] :bug: argument name it is not allowed - it is implicit, so any other name works (somehow) --- modules/bigbio/onsite/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index dabf5a0..8a90d7e 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -43,7 +43,7 @@ process ONSITE { if (algorithm == 'ascore') { // AScore: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ') algorithm_cmd = """ onsite ascore \\ -in ${mzml_file} \\ @@ -56,7 +56,7 @@ process ONSITE { else if (algorithm == 'phosphors') { // PhosphoRS: uses -in, -id, -out, --fragment-mass-unit fragment_unit = params.onsite_fragment_unit ?: 'Da' - def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') + def optional_flags = [add_decoys, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ') algorithm_cmd = """ onsite phosphors \\ -in ${mzml_file} \\ @@ -87,7 +87,7 @@ process ONSITE { def decoy_mass = params.onsite_decoy_mass ? "--decoy-mass ${params.onsite_decoy_mass}" : "--decoy-mass 79.966331" def decoy_losses = params.onsite_decoy_neutral_losses ? "--decoy-neutral-losses ${params.onsite_decoy_neutral_losses}" : "--decoy-neutral-losses 'X -H3PO4 -97.97690'" - def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { it -> it }.join(' \\\n ') + def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ') algorithm_cmd = """ onsite lucxor \\ -in ${mzml_file} \\ From eef2a9f42297c9f82d09d219b81df96e57b4e55e Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Wed, 11 Mar 2026 22:01:24 +0100 Subject: [PATCH 7/7] :art: make prefix global to module - variable local to script: use def - variablel global to module: leave out def Should probably only be done with prefix to not clutter namespaces. As a global variable prefix is used before it is defined in the module file. --- modules/bigbio/onsite/main.nf | 4 ++-- modules/bigbio/onsite/meta.yml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 8a90d7e..de82e09 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -11,7 +11,7 @@ process ONSITE { tuple val(meta), path(mzml_file), path(id_file) output: - tuple val(meta), path("${task.ext.prefix ?: meta.id}_*.idXML"), emit: ptm_in_id_onsite + tuple val(meta), path("${prefix}_*.idXML"), emit: ptm_in_id_onsite path "versions.yml", emit: versions path "*.log", emit: log @@ -20,7 +20,7 @@ process ONSITE { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" // Algorithm selection: lucxor (default), ascore, or phosphors def algorithm = params.onsite_algorithm ?: 'lucxor' diff --git a/modules/bigbio/onsite/meta.yml b/modules/bigbio/onsite/meta.yml index 0d19d71..3956abd 100644 --- a/modules/bigbio/onsite/meta.yml +++ b/modules/bigbio/onsite/meta.yml @@ -44,10 +44,11 @@ output: type: map description: | Groovy Map containing sample information - - ${id_file.baseName}_*.idXML: + - ${prefix}_*.idXML: type: file - description: idXML file containing PTM localization results from onsite - pattern: "${id_file.baseName}_*.idXML" + description: Output idXML file containing PTM localization results from + onsite + pattern: "${prefix}_*.idXML" ontologies: [] log: - "*.log":