From 69051e7e178aef7410a626df0c518660a4496c70 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Mon, 22 Jun 2026 21:58:57 +0800 Subject: [PATCH 1/5] bump version --- modules/bigbio/onsite/main.nf | 18 +++-- modules/bigbio/onsite/tests/main.nf.test | 81 +++++++++++++++++++ modules/bigbio/onsite/tests/main.nf.test.snap | 50 ------------ tests/config/test_data.config | 2 + 4 files changed, 95 insertions(+), 56 deletions(-) delete mode 100644 modules/bigbio/onsite/tests/main.nf.test.snap diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 0b0f55c..beca22b 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -4,14 +4,14 @@ process ONSITE { label 'onsite' container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container - ? 'oras://ghcr.io/bigbio/pyonsite-sif:0.0.4' - : 'ghcr.io/bigbio/pyonsite:0.0.4'}" + ? 'oras://ghcr.io/bigbio/pyonsite-sif:0.0.5' + : 'ghcr.io/bigbio/pyonsite:0.0.5'}" input: tuple val(meta), path(mzml_file), path(id_file) output: - tuple val(meta), path("${prefix}_*.idparquet"), emit: ptm_in_id_onsite + tuple val(meta), path("${prefix}_*.{idparquet,idXML,mzIdentML}"), emit: ptm_in_id_onsite path "versions.yml", emit: versions path "*.log", emit: log @@ -36,6 +36,12 @@ process ONSITE { def fragment_unit = '' def add_decoys = onsite_add_decoys ? '--add-decoys' : '' def debug = params.onsite_debug ? '--debug' : '' + def suffix = id_file.contains(".idparquet") + ? "idparquet" + : id_file.contains(".idXML") + ? "idXML" + : id_file.contains(".mzIdentML") + ? "mzIdentML" // Build algorithm-specific command def algorithm_cmd = '' @@ -48,7 +54,7 @@ process ONSITE { onsite ascore \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${prefix}_ascore.idparquet \\ + -out ${prefix}_ascore.${suffix} \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} """ @@ -61,7 +67,7 @@ process ONSITE { onsite phosphors \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${prefix}_phosphors.idparquet \\ + -out ${prefix}_phosphors.${suffix} \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''} ${args} @@ -92,7 +98,7 @@ process ONSITE { onsite lucxor \\ -in ${mzml_file} \\ -id ${id_file} \\ - -out ${prefix}_lucxor.idparquet \\ + -out ${prefix}_lucxor.${suffix} \\ --fragment-method ${fragment_method} \\ --fragment-mass-tolerance ${fragment_tolerance} \\ --fragment-error-units ${fragment_unit} \\ diff --git a/modules/bigbio/onsite/tests/main.nf.test b/modules/bigbio/onsite/tests/main.nf.test index 340d85e..587af85 100644 --- a/modules/bigbio/onsite/tests/main.nf.test +++ b/modules/bigbio/onsite/tests/main.nf.test @@ -90,6 +90,87 @@ nextflow_process { } } + test("Should run AScore algorithm with idXML input") { + + when { + process { + """ + input[0] = [ + [ id: 'test', mzml_id: 'test_sample' ], + file(params.test_data['proteomics']['onsite']['idxml_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_idxml") + 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 with idXML input") { + + when { + process { + """ + input[0] = [ + [ id: 'test', mzml_id: 'test_sample' ], + file(params.test_data['proteomics']['onsite']['idxml_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_idxml") + 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 with idXML input") { + + when { + process { + """ + input[0] = [ + [ id: 'test', mzml_id: 'test_sample' ], + file(params.test_data['proteomics']['onsite']['idxml_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_idxml") + 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" diff --git a/modules/bigbio/onsite/tests/main.nf.test.snap b/modules/bigbio/onsite/tests/main.nf.test.snap deleted file mode 100644 index 19a3f61..0000000 --- a/modules/bigbio/onsite/tests/main.nf.test.snap +++ /dev/null @@ -1,50 +0,0 @@ -{ - "versions_phosphors": { - "content": [ - [ - "versions.yml:md5,bafdb21e8e35a3f6128f4b8fb2f17fa6" - ] - ], - "timestamp": "2026-03-22T22:19:06.163312", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - }, - "versions_ascore": { - "content": [ - [ - "versions.yml:md5,e0bda208d6e29ca106d701db6ff8c6c9" - ] - ], - "timestamp": "2026-03-22T22:17:57.833213", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - }, - "versions_stub": { - "content": [ - [ - "versions.yml:md5,669fa42376f9ff6641abd22c67e507d6" - ] - ], - "timestamp": "2026-03-22T22:25:52.844037", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - }, - "versions_lucxor": { - "content": [ - [ - "versions.yml:md5,669fa42376f9ff6641abd22c67e507d6" - ] - ], - "timestamp": "2026-03-22T22:22:30.192671", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.4" - } - } -} \ No newline at end of file diff --git a/tests/config/test_data.config b/tests/config/test_data.config index bb0b73b..39b7290 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -22,6 +22,8 @@ params { // Test data for onsite PTM localization module mzml = "https://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/quantms-ci-github/onsite/Phospho_redissolve_final_01.mzML" idparquet = System.getenv('ONSITE_IDPARQUET_PATH') ?: "https://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/quantms-ci-github/onsite/Phospho_redissolve_final_01_clean_perc.idparquet" + idxml = "https://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/quantms-ci-github/onsite/1_consensus_fdr_filter_pep.idXML" + idxml_mzml = "https://ftp.pride.ebi.ac.uk/pub/databases/pride/resources/proteomes/quantms-ci-github/onsite/1.mzML" } qpx { // DIA-NN results for QPX export testing (reuses pmultiqc DIANN example) From a72ac609a77c3b509a9a87e281fcafa7e79c8e49 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Mon, 22 Jun 2026 22:03:07 +0800 Subject: [PATCH 2/5] Update main.nf --- 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 beca22b..6f5c62c 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -36,11 +36,11 @@ process ONSITE { def fragment_unit = '' def add_decoys = onsite_add_decoys ? '--add-decoys' : '' def debug = params.onsite_debug ? '--debug' : '' - def suffix = id_file.contains(".idparquet") + def suffix = id_file.name.endsWith(".idparquet") ? "idparquet" - : id_file.contains(".idXML") + : id_file.name.endsWith(".idXML") ? "idXML" - : id_file.contains(".mzIdentML") + : id_file.name.endsWith(".mzIdentML") ? "mzIdentML" // Build algorithm-specific command From a9d3a4b74110e53fc35632f91223ce4154556d11 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Mon, 22 Jun 2026 22:23:08 +0800 Subject: [PATCH 3/5] Update main.nf --- modules/bigbio/onsite/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bigbio/onsite/main.nf b/modules/bigbio/onsite/main.nf index 6f5c62c..c59d652 100644 --- a/modules/bigbio/onsite/main.nf +++ b/modules/bigbio/onsite/main.nf @@ -41,7 +41,7 @@ process ONSITE { : id_file.name.endsWith(".idXML") ? "idXML" : id_file.name.endsWith(".mzIdentML") - ? "mzIdentML" + ? "mzIdentML" : "idparquet" // Build algorithm-specific command def algorithm_cmd = '' From d62aeb892bcad3113a8c4ebb4efa9e6b6c31afb5 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Mon, 22 Jun 2026 22:28:52 +0800 Subject: [PATCH 4/5] Create main.nf.test.snap --- modules/bigbio/onsite/tests/main.nf.test.snap | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/bigbio/onsite/tests/main.nf.test.snap diff --git a/modules/bigbio/onsite/tests/main.nf.test.snap b/modules/bigbio/onsite/tests/main.nf.test.snap new file mode 100644 index 0000000..19a3f61 --- /dev/null +++ b/modules/bigbio/onsite/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "versions_phosphors": { + "content": [ + [ + "versions.yml:md5,bafdb21e8e35a3f6128f4b8fb2f17fa6" + ] + ], + "timestamp": "2026-03-22T22:19:06.163312", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "versions_ascore": { + "content": [ + [ + "versions.yml:md5,e0bda208d6e29ca106d701db6ff8c6c9" + ] + ], + "timestamp": "2026-03-22T22:17:57.833213", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "versions_stub": { + "content": [ + [ + "versions.yml:md5,669fa42376f9ff6641abd22c67e507d6" + ] + ], + "timestamp": "2026-03-22T22:25:52.844037", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "versions_lucxor": { + "content": [ + [ + "versions.yml:md5,669fa42376f9ff6641abd22c67e507d6" + ] + ], + "timestamp": "2026-03-22T22:22:30.192671", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + } +} \ No newline at end of file From 873ace190bcc96f4079e04200114e3fbbbf0f3f6 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Mon, 22 Jun 2026 22:42:28 +0800 Subject: [PATCH 5/5] update --- modules/bigbio/onsite/environment.yml | 2 +- modules/bigbio/onsite/meta.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/bigbio/onsite/environment.yml b/modules/bigbio/onsite/environment.yml index d1890de..dccfdef 100644 --- a/modules/bigbio/onsite/environment.yml +++ b/modules/bigbio/onsite/environment.yml @@ -3,4 +3,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::pyonsite=0.0.4 + - bioconda::pyonsite=0.0.5 diff --git a/modules/bigbio/onsite/meta.yml b/modules/bigbio/onsite/meta.yml index d82458b..b8f4e16 100644 --- a/modules/bigbio/onsite/meta.yml +++ b/modules/bigbio/onsite/meta.yml @@ -35,8 +35,8 @@ input: ontologies: [] - id_file: type: file - description: Protein/peptide identifications file in idparquet format - pattern: "*.idparquet" + description: Protein/peptide identifications file + pattern: "*.{idparquet,idXML,mzIdentML}" ontologies: [] output: ptm_in_id_onsite: @@ -46,9 +46,9 @@ output: Groovy Map containing sample information - ${prefix}_*.idparquet: type: file - description: Output idparquet file containing PTM localization results from + description: Output id file containing PTM localization results from onsite - pattern: "${prefix}_*.idparquet" + pattern: "${prefix}_*.{idparquet,idXML,mzIdentML}" ontologies: [] log: - "*.log":