From 2916f3bebae937f25e020c58b638193b25fa3045 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Tue, 9 Jan 2024 12:39:55 +0000 Subject: [PATCH 01/18] Setup cometadapter module --- .../cometadapter/environment.yml | 9 +++ .../openmsthirdparty/cometadapter/main.nf | 55 +++++++++++++++++ .../openmsthirdparty/cometadapter/meta.yml | 55 +++++++++++++++++ .../cometadapter/tests/main.nf.test | 61 +++++++++++++++++++ .../cometadapter/tests/nextflow.config | 7 +++ .../cometadapter/tests/tags.yml | 2 + 6 files changed, 189 insertions(+) create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/environment.yml create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/main.nf create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/meta.yml create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/tests/tags.yml diff --git a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml new file mode 100644 index 00000000000..248799837a6 --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "openmsthirdparty_cometadapter" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::openms-thirdparty=3.1.0" diff --git a/modules/nf-core/openmsthirdparty/cometadapter/main.nf b/modules/nf-core/openmsthirdparty/cometadapter/main.nf new file mode 100644 index 00000000000..ca41d67a76c --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/main.nf @@ -0,0 +1,55 @@ +process OPENMSTHIRDPARTY_COMETADAPTER { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/openms-thirdparty:3.1.0--h9ee0642_3' : + 'biocontainers/openms-thirdparty:3.1.0--h9ee0642_3' }" + + input: + tuple val(meta), path(mzml), path(fasta) + + output: + tuple val(meta), path("*.idXML"), emit: idxml + tuple val(meta), path("*.tsv") , emit: pin + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + CometAdapter -in $mzml \\ + -database $fasta \\ + -out ${prefix}.idXML \\ + -pin_out ${prefix}_pin.tsv \\ + -threads $task.cpus \\ + $args + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) + Comet: \$(comet 2>&1 | grep -E "Comet version.*" | sed 's/Comet version //g' | sed 's/"//g') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.idXML + touch ${prefix}_pin.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) + Comet: \$(comet 2>&1 | grep -E "Comet version.*" | sed 's/Comet version //g' | sed 's/"//g') + END_VERSIONS + """ +} diff --git a/modules/nf-core/openmsthirdparty/cometadapter/meta.yml b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml new file mode 100644 index 00000000000..f86ffd0ec7f --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml @@ -0,0 +1,55 @@ +name: "openmsthirdparty_cometadapter" +description: Annotates MS/MS spectra using Comet. +keywords: + - search engine + - fasta + - mzml + - openms + - proteomics +tools: + - openms: + description: "OpenMS is an open-source software C++ library for LC-MS data management and analyses" + homepage: "https://openms.de" + documentation: "https://openms.readthedocs.io/en/latest/index.html" + tool_dev_url: "https://github.com/OpenMS/OpenMS" + doi: "10.1038/nmeth.3959" + licence: "['BSD']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - mzml: + type: file + description: File containing mass spectra in mzML format + pattern: "*.{mzML}" + - fasta: + type: file + description: Protein sequence database containing targets and decoys + pattern: "*.{fasta}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - idxml: + type: file + description: File containing target and decoy hits in idXML format + pattern: "*.{idXML}" + - pin: + type: file + description: TSV file tailored as Percolator input (pin) file + pattern: "*.{tsv}" + +authors: + - "@jonasscheid" +maintainers: + - "@jonasscheid" diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test new file mode 100644 index 00000000000..1193fa5229d --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -0,0 +1,61 @@ +nextflow_process { + + name "Test Process OPENMSTHIRDPARTY_COMETADAPTER" + script "../main.nf" + process "OPENMSTHIRDPARTY_COMETADAPTER" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "openmsthirdparty" + tag "openmsthirdparty/cometadapter" + + test("proteomics - search engine comet - mzml") { + + when { + process { + """ + input[0] = [ + [id:'test'], + // TODO: First introduce thermorawfileparser and use it in setup + file(params.test_data['proteomics']['openms']['idxml1'], checkIfExists: true), + file(params.test_data['proteomics']['database']['yeast_ups'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. + test("proteomics - search engine comet - mzml - stub") { + + options "-stub" + + when { + process { + """ + // TODO: First introduce thermorawfileparser and use it in setup + file(params.test_data['proteomics']['openms']['idxml1'], checkIfExists: true), + file(params.test_data['proteomics']['database']['yeast_ups'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config b/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config new file mode 100644 index 00000000000..3e867951d9e --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName:OPENMSTHIRDPARTY_COMETADAPTER { + ext.args = "-precursor_charge 2:3" + } + +} diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/tags.yml b/modules/nf-core/openmsthirdparty/cometadapter/tests/tags.yml new file mode 100644 index 00000000000..44dd62ab99a --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/tags.yml @@ -0,0 +1,2 @@ +openmsthirdparty/cometadapter: + - "modules/nf-core/openmsthirdparty/cometadapter/**" From e2ae09d761194ce602da5c2bd162ad386ccc5215 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Sun, 4 Feb 2024 10:52:20 +0000 Subject: [PATCH 02/18] cometadapter draft --- .../openmsthirdparty/cometadapter/main.nf | 4 ++- .../cometadapter/tests/main.nf.test | 33 ++++++++++++++----- tests/config/test_data.config | 1 + 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/main.nf b/modules/nf-core/openmsthirdparty/cometadapter/main.nf index ca41d67a76c..f30eb1223a2 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/main.nf +++ b/modules/nf-core/openmsthirdparty/cometadapter/main.nf @@ -12,6 +12,7 @@ process OPENMSTHIRDPARTY_COMETADAPTER { output: tuple val(meta), path("*.idXML"), emit: idxml + // TODO: Set optional tuple val(meta), path("*.tsv") , emit: pin path "versions.yml" , emit: versions @@ -23,7 +24,8 @@ process OPENMSTHIRDPARTY_COMETADAPTER { def prefix = task.ext.prefix ?: "${meta.id}" """ - CometAdapter -in $mzml \\ + CometAdapter \\ + -in $mzml \\ -database $fasta \\ -out ${prefix}.idXML \\ -pin_out ${prefix}_pin.tsv \\ diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 1193fa5229d..76eb0df2a7e 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -7,20 +7,35 @@ nextflow_process { tag "modules" tag "modules_nfcore" + tag "openms" tag "openmsthirdparty" tag "openmsthirdparty/cometadapter" + tag "thermorawfileparser" + + setup { + run("THERMORAWFILEPARSER") { + script "../../../thermorawfileparser/main.nf" + process { + """ + input[0] = Channel.of( + [ id:'test'], // meta map + file(params.modules_testdata_base_path +'proteomics/msspectra/PXD012083_e005640_II.raw, checkIfExists: true) + ) + """ + } + } + } test("proteomics - search engine comet - mzml") { when { process { """ - input[0] = [ + input[0] = Channel.of( [id:'test'], - // TODO: First introduce thermorawfileparser and use it in setup - file(params.test_data['proteomics']['openms']['idxml1'], checkIfExists: true), - file(params.test_data['proteomics']['database']['yeast_ups'], checkIfExists: true) - ] + THERMORAWFILEPARSER.out.spectra, + file(params.modules_testdata_base_path +'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) + ) """ } } @@ -42,9 +57,11 @@ nextflow_process { when { process { """ - // TODO: First introduce thermorawfileparser and use it in setup - file(params.test_data['proteomics']['openms']['idxml1'], checkIfExists: true), - file(params.test_data['proteomics']['database']['yeast_ups'], checkIfExists: true) + input[0] = Channel.of( + [id:'test'], + THERMORAWFILEPARSER.out.spectra, + file(params.modules_testdata_base_path +'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) + ) """ } } diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 9ebe1da7934..ce77236a462 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -683,6 +683,7 @@ params { } 'database' { yeast_ups = "${params.test_data_base}/data/proteomics/database/yeast_UPS.fasta" + swissprot = "${params.test_data_base}/data/proteomics/database/UP000005640_9606.fasta" } 'maxquant' { mq_contrasts = "${params.test_data_base}/data/proteomics/maxquant/MaxQuant_contrasts.csv" From 46f304d223945fb55fd1c1ca8656321435a6f57b Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Wed, 11 Sep 2024 11:49:49 +0000 Subject: [PATCH 03/18] finalize tests --- .../openmsthirdparty/cometadapter/main.nf | 4 +- .../cometadapter/tests/main.nf.test | 45 ++++++++------ .../cometadapter/tests/main.nf.test.snap | 60 +++++++++++++++++++ 3 files changed, 89 insertions(+), 20 deletions(-) create mode 100644 modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap diff --git a/modules/nf-core/openmsthirdparty/cometadapter/main.nf b/modules/nf-core/openmsthirdparty/cometadapter/main.nf index f30eb1223a2..bf216bacb65 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/main.nf +++ b/modules/nf-core/openmsthirdparty/cometadapter/main.nf @@ -12,8 +12,7 @@ process OPENMSTHIRDPARTY_COMETADAPTER { output: tuple val(meta), path("*.idXML"), emit: idxml - // TODO: Set optional - tuple val(meta), path("*.tsv") , emit: pin + tuple val(meta), path("*.tsv") , emit: pin, optional: true path "versions.yml" , emit: versions when: @@ -28,7 +27,6 @@ process OPENMSTHIRDPARTY_COMETADAPTER { -in $mzml \\ -database $fasta \\ -out ${prefix}.idXML \\ - -pin_out ${prefix}_pin.tsv \\ -threads $task.cpus \\ $args diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 76eb0df2a7e..805073bc1c1 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -17,25 +17,37 @@ nextflow_process { script "../../../thermorawfileparser/main.nf" process { """ - input[0] = Channel.of( - [ id:'test'], // meta map - file(params.modules_testdata_base_path +'proteomics/msspectra/PXD012083_e005640_II.raw, checkIfExists: true) - ) + input[0] = [ + [ id:'test'], + file(params.modules_testdata_base_path + 'proteomics/msspectra/PXD012083_e005640_II.raw', checkIfExists: true) + ] + """ + } + } + + run("OPENMS_DECOYDATABASE") { + script "../../../openms/decoydatabase/main.nf" + process { + """ + input[0] = [ + [ id:'test'], + file(params.modules_testdata_base_path + 'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) + ] """ } } } - test("proteomics - search engine comet - mzml") { + test("proteomics - comet") { when { process { """ - input[0] = Channel.of( - [id:'test'], - THERMORAWFILEPARSER.out.spectra, - file(params.modules_testdata_base_path +'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) - ) + input[0] = [ + [ id:'test' ], + THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, + OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} + ] """ } } @@ -49,19 +61,18 @@ nextflow_process { } - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. - test("proteomics - search engine comet - mzml - stub") { + test("proteomics - comet - stub") { options "-stub" when { process { """ - input[0] = Channel.of( - [id:'test'], - THERMORAWFILEPARSER.out.spectra, - file(params.modules_testdata_base_path +'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) - ) + input[0] = [ + [ id:'test' ], + THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, + OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} + ] """ } } diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap new file mode 100644 index 00000000000..5b16685364d --- /dev/null +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -0,0 +1,60 @@ +{ + "proteomics - comet": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "idxml": [ + + ], + "pin": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-11T10:50:13.336752358" + }, + "proteomics - comet - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "idxml": [ + + ], + "pin": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-11T10:50:23.850286081" + } +} \ No newline at end of file From d264c69700128ee2df520e4298177d139e72a806 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Wed, 11 Sep 2024 12:43:22 +0000 Subject: [PATCH 04/18] remove defaults --- modules/nf-core/openmsthirdparty/cometadapter/environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml index 248799837a6..eec11996ccc 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml @@ -4,6 +4,5 @@ name: "openmsthirdparty_cometadapter" channels: - conda-forge - bioconda - - defaults dependencies: - "bioconda::openms-thirdparty=3.1.0" From 7c93a6699b380a7a7a8a73a9a4c7d6d8923010ab Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Wed, 11 Sep 2024 13:21:55 +0000 Subject: [PATCH 05/18] enclosing input as channel --- .../cometadapter/tests/main.nf.test | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 805073bc1c1..1d61e693ff5 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -17,10 +17,10 @@ nextflow_process { script "../../../thermorawfileparser/main.nf" process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test'], file(params.modules_testdata_base_path + 'proteomics/msspectra/PXD012083_e005640_II.raw', checkIfExists: true) - ] + ]) """ } } @@ -29,10 +29,10 @@ nextflow_process { script "../../../openms/decoydatabase/main.nf" process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test'], file(params.modules_testdata_base_path + 'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) - ] + ]) """ } } @@ -43,11 +43,11 @@ nextflow_process { when { process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test' ], THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} - ] + ]) """ } } @@ -68,11 +68,11 @@ nextflow_process { when { process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test' ], THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} - ] + ]) """ } } From 4ee4f0cae9b616399f1dc393476f43ee320a1246 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Wed, 11 Sep 2024 15:12:59 +0000 Subject: [PATCH 06/18] replace collect with map --- .../cometadapter/tests/main.nf.test | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 1d61e693ff5..244c8227665 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -43,11 +43,11 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test' ], - THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, - OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} - ]) + THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, + OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} + ] """ } } @@ -68,11 +68,11 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ + input[0] = [ [ id:'test' ], - THERMORAWFILEPARSER.out.spectra.collect{ meta, spectra -> spectra}, - OPENMS_DECOYDATABASE.out.decoy_fasta.collect { meta, decoy_fasta -> decoy_fasta} - ]) + THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, + OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} + ] """ } } From 9c7972126e1e61050e0f3bbeb53a699ba58b8698 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Wed, 11 Sep 2024 15:18:19 +0000 Subject: [PATCH 07/18] add channel of again --- .../openmsthirdparty/cometadapter/tests/main.nf.test | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 244c8227665..5c72e55f935 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -11,6 +11,7 @@ nextflow_process { tag "openmsthirdparty" tag "openmsthirdparty/cometadapter" tag "thermorawfileparser" + tag "openmsdecoydatabase" setup { run("THERMORAWFILEPARSER") { @@ -43,11 +44,11 @@ nextflow_process { when { process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test' ], THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} - ] + ]) """ } } @@ -68,11 +69,11 @@ nextflow_process { when { process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test' ], THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} - ] + ]) """ } } From 99c6b3d892a9c3e889566b423af27191166f074f Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Thu, 12 Sep 2024 08:55:05 +0000 Subject: [PATCH 08/18] fix input channles by joining them --- .../cometadapter/tests/main.nf.test | 18 +++---- .../cometadapter/tests/main.nf.test.snap | 54 ++++++++++++++----- .../cometadapter/tests/nextflow.config | 15 +++++- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 5c72e55f935..b03c72d1501 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -44,11 +44,10 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ - [ id:'test' ], - THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, - OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} - ]) + input[0] = + THERMORAWFILEPARSER.out.spectra.join( + OPENMS_DECOYDATABASE.out.decoy_fasta + ) """ } } @@ -69,11 +68,10 @@ nextflow_process { when { process { """ - input[0] = Channel.of([ - [ id:'test' ], - THERMORAWFILEPARSER.out.spectra.map{ meta, spectra -> spectra}, - OPENMS_DECOYDATABASE.out.decoy_fasta.map { meta, decoy_fasta -> decoy_fasta} - ]) + input[0] = + THERMORAWFILEPARSER.out.spectra.join( + OPENMS_DECOYDATABASE.out.decoy_fasta + ) """ } } diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap index 5b16685364d..78210e24a7b 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -3,22 +3,32 @@ "content": [ { "0": [ - + [ + { + "id": "test" + }, + "test.idXML:md5,4d54ac441baebb3a5a4c3150ebb93e6b" + ] ], "1": [ ], "2": [ - + "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" ], "idxml": [ - + [ + { + "id": "test" + }, + "test.idXML:md5,4d54ac441baebb3a5a4c3150ebb93e6b" + ] ], "pin": [ ], "versions": [ - + "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" ] } ], @@ -26,28 +36,48 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-11T10:50:13.336752358" + "timestamp": "2024-09-11T20:28:19.253992159" }, "proteomics - comet - stub": { "content": [ { "0": [ - + [ + { + "id": "test" + }, + "test.idXML:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "1": [ - + [ + { + "id": "test" + }, + "test_pin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "2": [ - + "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" ], "idxml": [ - + [ + { + "id": "test" + }, + "test.idXML:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "pin": [ - + [ + { + "id": "test" + }, + "test_pin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "versions": [ - + "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" ] } ], @@ -55,6 +85,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-11T10:50:23.850286081" + "timestamp": "2024-09-11T15:49:52.847161934" } } \ No newline at end of file diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config b/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config index 3e867951d9e..04e89d92942 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/nextflow.config @@ -1,7 +1,20 @@ process { withName:OPENMSTHIRDPARTY_COMETADAPTER { - ext.args = "-precursor_charge 2:3" + ext.args = [ + "-instrument low_res", + "-fragment_bin_offset 0.4", + "-precursor_mass_tolerance 5", + "-precursor_error_units 'ppm'", + "-fragment_mass_tolerance 0.50025", + "-digest_mass_range '800:5000'", + "-max_variable_mods_in_peptide 1", + "-precursor_charge '2:5'", + "-activation_method 'CID'", + "-variable_modifications 'Oxidation (M)'", + "-enzyme 'unspecific cleavage'", + "-spectrum_batch_size 0" + ].join(' ').trim() } } From 22bef312f78d90ab08807defcf3afdebe14af28c Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Thu, 12 Sep 2024 09:11:51 +0000 Subject: [PATCH 09/18] update correct snapshot --- .../openmsthirdparty/cometadapter/tests/main.nf.test.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap index 78210e24a7b..f8fffc9af56 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test.idXML:md5,4d54ac441baebb3a5a4c3150ebb93e6b" + "test.idXML:md5,2db421783283bb3988ae10ba983c29c5" ] ], "1": [ @@ -21,7 +21,7 @@ { "id": "test" }, - "test.idXML:md5,4d54ac441baebb3a5a4c3150ebb93e6b" + "test.idXML:md5,2db421783283bb3988ae10ba983c29c5" ] ], "pin": [ @@ -36,7 +36,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-11T20:28:19.253992159" + "timestamp": "2024-09-12T09:07:03.005635527" }, "proteomics - comet - stub": { "content": [ From 92c1f14c65fb141f849d8d6124c2c3fedb1f7237 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Thu, 12 Sep 2024 09:30:34 +0000 Subject: [PATCH 10/18] fix lint --- modules/nf-core/openmsthirdparty/cometadapter/environment.yml | 3 --- modules/nf-core/openmsthirdparty/cometadapter/meta.yml | 2 +- .../nf-core/openmsthirdparty/cometadapter/tests/main.nf.test | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml index eec11996ccc..3c2729e75f1 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml @@ -1,6 +1,3 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -name: "openmsthirdparty_cometadapter" channels: - conda-forge - bioconda diff --git a/modules/nf-core/openmsthirdparty/cometadapter/meta.yml b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml index f86ffd0ec7f..320693d6b1a 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/meta.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml @@ -13,7 +13,7 @@ tools: documentation: "https://openms.readthedocs.io/en/latest/index.html" tool_dev_url: "https://github.com/OpenMS/OpenMS" doi: "10.1038/nmeth.3959" - licence: "['BSD']" + licence: ['BSD'] input: - meta: diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index b03c72d1501..623553149c8 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -11,7 +11,7 @@ nextflow_process { tag "openmsthirdparty" tag "openmsthirdparty/cometadapter" tag "thermorawfileparser" - tag "openmsdecoydatabase" + tag "openms/decoydatabase" setup { run("THERMORAWFILEPARSER") { From 3df19f19049160f6fc57621b3f497a4d00ddf382 Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Thu, 12 Sep 2024 11:44:19 +0000 Subject: [PATCH 11/18] fix snapshots, comet writes timestamps in output file --- .../cometadapter/environment.yml | 1 + .../cometadapter/tests/main.nf.test | 14 ++-- .../cometadapter/tests/main.nf.test.snap | 79 +++++++++++-------- 3 files changed, 56 insertions(+), 38 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml index 3c2729e75f1..8837d5dc936 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml @@ -3,3 +3,4 @@ channels: - bioconda dependencies: - "bioconda::openms-thirdparty=3.1.0" + - "conda-forge::openms-thirdparty=3.1.0" diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 623553149c8..3a40de5b04b 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -51,14 +51,16 @@ nextflow_process { """ } } - + // Comet stores timestamp in output file, so we cannot compare checksums then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) + assert process.success + assert snapshot(process.out.versions).match("versions") + // Assert the search metadata + assert snapshot(file(process.out.idxml[0][1]).readLines()[0..30]).match() + // Make sure the file is not empty + assert file(process.out.idxml[0][1]).readLines().any { it.contains('ProteinHit') } + assert file(process.out.idxml[0][1]).readLines().any { it.contains('PeptideHit') } } - } test("proteomics - comet - stub") { diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap index f8fffc9af56..f56d2e6df31 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -1,42 +1,57 @@ { "proteomics - comet": { "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.idXML:md5,2db421783283bb3988ae10ba983c29c5" - ] - ], - "1": [ - - ], - "2": [ - "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" - ], - "idxml": [ - [ - { - "id": "test" - }, - "test.idXML:md5,2db421783283bb3988ae10ba983c29c5" - ] - ], - "pin": [ - - ], - "versions": [ - "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" - ] - } + [ + "", + "", + "", + "\t", + "\t\t", + "\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t", + "\t\t\t\t" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-12T11:36:43.06587411" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" + ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-12T09:07:03.005635527" + "timestamp": "2024-09-12T11:36:42.932505848" }, "proteomics - comet - stub": { "content": [ @@ -85,6 +100,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-11T15:49:52.847161934" + "timestamp": "2024-09-12T11:37:10.256724717" } } \ No newline at end of file From 0003ab47a491777d84119775b8f068942ed21e65 Mon Sep 17 00:00:00 2001 From: jonasscheid Date: Thu, 12 Sep 2024 11:51:07 +0000 Subject: [PATCH 12/18] prettier --- modules/nf-core/openmsthirdparty/cometadapter/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/meta.yml b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml index 320693d6b1a..e37f6af8264 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/meta.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/meta.yml @@ -13,7 +13,7 @@ tools: documentation: "https://openms.readthedocs.io/en/latest/index.html" tool_dev_url: "https://github.com/OpenMS/OpenMS" doi: "10.1038/nmeth.3959" - licence: ['BSD'] + licence: ["BSD"] input: - meta: From 8b2fbf261a4ee1d77a73ee29c1039ee7597ac310 Mon Sep 17 00:00:00 2001 From: Jonas Scheid <43858870+jonasscheid@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:55:21 +0200 Subject: [PATCH 13/18] Update environment.yml --- modules/nf-core/openmsthirdparty/cometadapter/environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml index 8837d5dc936..3c2729e75f1 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/environment.yml +++ b/modules/nf-core/openmsthirdparty/cometadapter/environment.yml @@ -3,4 +3,3 @@ channels: - bioconda dependencies: - "bioconda::openms-thirdparty=3.1.0" - - "conda-forge::openms-thirdparty=3.1.0" From 897702a777ce21afacf3dff474f40fb96faf9824 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Fri, 13 Sep 2024 11:29:32 +0000 Subject: [PATCH 14/18] strip out suffix version tag, which differs between container and conda --- .../nf-core/openmsthirdparty/cometadapter/main.nf | 4 ++-- .../openmsthirdparty/cometadapter/tests/main.nf.test | 9 +++------ .../cometadapter/tests/main.nf.test.snap | 12 ++++++------ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/main.nf b/modules/nf-core/openmsthirdparty/cometadapter/main.nf index bf216bacb65..9970235b3a3 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/main.nf +++ b/modules/nf-core/openmsthirdparty/cometadapter/main.nf @@ -33,7 +33,7 @@ process OPENMSTHIRDPARTY_COMETADAPTER { cat <<-END_VERSIONS > versions.yml "${task.process}": - CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) + CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) Comet: \$(comet 2>&1 | grep -E "Comet version.*" | sed 's/Comet version //g' | sed 's/"//g') END_VERSIONS """ @@ -48,7 +48,7 @@ process OPENMSTHIRDPARTY_COMETADAPTER { cat <<-END_VERSIONS > versions.yml "${task.process}": - CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) + CometAdapter: \$(CometAdapter 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) Comet: \$(comet 2>&1 | grep -E "Comet version.*" | sed 's/Comet version //g' | sed 's/"//g') END_VERSIONS """ diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index 3a40de5b04b..f16f813d83e 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -54,12 +54,12 @@ nextflow_process { // Comet stores timestamp in output file, so we cannot compare checksums then { assert process.success - assert snapshot(process.out.versions).match("versions") // Assert the search metadata assert snapshot(file(process.out.idxml[0][1]).readLines()[0..30]).match() // Make sure the file is not empty assert file(process.out.idxml[0][1]).readLines().any { it.contains('ProteinHit') } assert file(process.out.idxml[0][1]).readLines().any { it.contains('PeptideHit') } + assert snapshot(process.out.versions).match("versions") } } @@ -79,12 +79,9 @@ nextflow_process { } then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) + assert process.success + assert snapshot(process.out).match() } - } } diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap index f56d2e6df31..c17bd58898c 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -39,19 +39,19 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-12T11:36:43.06587411" + "timestamp": "2024-09-13T11:21:31.257498235" }, "versions": { "content": [ [ - "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" + "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-12T11:36:42.932505848" + "timestamp": "2024-09-13T11:21:31.6365673" }, "proteomics - comet - stub": { "content": [ @@ -73,7 +73,7 @@ ] ], "2": [ - "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" + "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" ], "idxml": [ [ @@ -92,7 +92,7 @@ ] ], "versions": [ - "versions.yml:md5,2934212e98ffe9f348f6ad478805de08" + "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" ] } ], @@ -100,6 +100,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-12T11:37:10.256724717" + "timestamp": "2024-09-13T11:21:44.559622507" } } \ No newline at end of file From 6d0689737f341b2a29ac47abdb1ceed882c8d4f6 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Fri, 13 Sep 2024 14:10:20 +0000 Subject: [PATCH 15/18] move to version content check instead of hash --- .../cometadapter/tests/main.nf.test | 3 +- .../cometadapter/tests/main.nf.test.snap | 58 ++----------------- 2 files changed, 7 insertions(+), 54 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test index f16f813d83e..cf1a0bcddcd 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test @@ -59,7 +59,7 @@ nextflow_process { // Make sure the file is not empty assert file(process.out.idxml[0][1]).readLines().any { it.contains('ProteinHit') } assert file(process.out.idxml[0][1]).readLines().any { it.contains('PeptideHit') } - assert snapshot(process.out.versions).match("versions") + assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") } } @@ -80,7 +80,6 @@ nextflow_process { then { assert process.success - assert snapshot(process.out).match() } } diff --git a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap index c17bd58898c..9eb65951ab5 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap +++ b/modules/nf-core/openmsthirdparty/cometadapter/tests/main.nf.test.snap @@ -39,67 +39,21 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-13T11:21:31.257498235" + "timestamp": "2024-09-13T13:57:34.932657501" }, "versions": { - "content": [ - [ - "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-13T11:21:31.6365673" - }, - "proteomics - comet - stub": { "content": [ { - "0": [ - [ - { - "id": "test" - }, - "test.idXML:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - { - "id": "test" - }, - "test_pin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" - ], - "idxml": [ - [ - { - "id": "test" - }, - "test.idXML:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "pin": [ - [ - { - "id": "test" - }, - "test_pin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,f0de47799613a13f8de9c5f2a39b0880" - ] + "OPENMSTHIRDPARTY_COMETADAPTER": { + "CometAdapter": "3.1.0", + "Comet": "2023.01 rev. 2" + } } ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-13T11:21:44.559622507" + "timestamp": "2024-09-13T13:57:35.577894316" } } \ No newline at end of file From c1aacd36aeebaf60fea40443b7316d19e82643e0 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Fri, 13 Sep 2024 14:30:00 +0000 Subject: [PATCH 16/18] align conda version and container version tag --- modules/nf-core/openmsthirdparty/cometadapter/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/openmsthirdparty/cometadapter/main.nf b/modules/nf-core/openmsthirdparty/cometadapter/main.nf index 9970235b3a3..b193974ae86 100644 --- a/modules/nf-core/openmsthirdparty/cometadapter/main.nf +++ b/modules/nf-core/openmsthirdparty/cometadapter/main.nf @@ -4,8 +4,8 @@ process OPENMSTHIRDPARTY_COMETADAPTER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/openms-thirdparty:3.1.0--h9ee0642_3' : - 'biocontainers/openms-thirdparty:3.1.0--h9ee0642_3' }" + 'https://depot.galaxyproject.org/singularity/openms-thirdparty:3.1.0--h9ee0642_4' : + 'biocontainers/openms-thirdparty:3.1.0--h9ee0642_4' }" input: tuple val(meta), path(mzml), path(fasta) From 49b5a8ba1301abe10845574a1f798c8590a9f5a1 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Mon, 16 Sep 2024 05:28:37 +0000 Subject: [PATCH 17/18] add idmassaccuracy module --- .../openms/idmassaccuracy/environment.yml | 5 ++ modules/nf-core/openms/idmassaccuracy/main.nf | 52 +++++++++++ .../nf-core/openms/idmassaccuracy/meta.yml | 55 ++++++++++++ .../openms/idmassaccuracy/tests/main.nf.test | 81 +++++++++++++++++ .../idmassaccuracy/tests/main.nf.test.snap | 90 +++++++++++++++++++ .../idmassaccuracy/tests/nextflow.config | 27 ++++++ 6 files changed, 310 insertions(+) create mode 100644 modules/nf-core/openms/idmassaccuracy/environment.yml create mode 100644 modules/nf-core/openms/idmassaccuracy/main.nf create mode 100644 modules/nf-core/openms/idmassaccuracy/meta.yml create mode 100644 modules/nf-core/openms/idmassaccuracy/tests/main.nf.test create mode 100644 modules/nf-core/openms/idmassaccuracy/tests/main.nf.test.snap create mode 100644 modules/nf-core/openms/idmassaccuracy/tests/nextflow.config diff --git a/modules/nf-core/openms/idmassaccuracy/environment.yml b/modules/nf-core/openms/idmassaccuracy/environment.yml new file mode 100644 index 00000000000..5793e993cc5 --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::openms=3.1.0" diff --git a/modules/nf-core/openms/idmassaccuracy/main.nf b/modules/nf-core/openms/idmassaccuracy/main.nf new file mode 100644 index 00000000000..5460f19996b --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/main.nf @@ -0,0 +1,52 @@ +process OPENMS_IDMASSACCURACY { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/openms:3.1.0--h191ead1_4' : + 'biocontainers/openms:3.1.0--h191ead1_4' }" + + input: + tuple val(meta), path(mzmls), path(idxmls) + + output: + tuple val(meta), path("*frag_mass_err.tsv") , emit: frag_err + tuple val(meta), path("*prec_mass_err.tsv") , emit: prec_err, optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + IDMassAccuracy \\ + -in $mzmls \\ + -id_in $idxmls \\ + -out_fragment ${prefix}_frag_mass_err.tsv \\ + -threads $task.cpus \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}_frag_mass_err.tsv + touch ${prefix}_prec_mass_err.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) + END_VERSIONS + """ +} diff --git a/modules/nf-core/openms/idmassaccuracy/meta.yml b/modules/nf-core/openms/idmassaccuracy/meta.yml new file mode 100644 index 00000000000..e14a2eb09bb --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/meta.yml @@ -0,0 +1,55 @@ +name: "openms_idmassaccuracy" +description: Calculates a distribution of the mass error from given mass spectra and IDs. +keywords: + - mass_error + - openms + - proteomics +tools: + - "openms": + description: "OpenMS is an open-source software C++ library for LC-MS data management and analyses" + homepage: "https://openms.de" + documentation: "https://openms.readthedocs.io/en/latest/index.html" + tool_dev_url: "https://github.com/OpenMS/OpenMS" + doi: "10.1038/s41592-024-02197-7" + licence: ["BSD"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - mzmls: + type: file + description: | + List containing one or more mzML files + e.g. `[ 'file1.mzML', 'file2.mzML' ]` + pattern: "*.{mzML}" + - idxmls: + type: file + description: | + List containing one or more idXML files + e.g. `[ 'file1.idXML', 'file2.idXML' ]` + pattern: "*.{idXML}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test' ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - frag_err: + type: file + description: TSV file containing the fragment mass errors + pattern: "*frag_mass_err.{tsv}" + - prec_err: + type: file + description: Optional TSV file containing the precursor mass errors + pattern: "*prec_mass_err.{tsv}" + +authors: + - "@jonasscheid" diff --git a/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test b/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test new file mode 100644 index 00000000000..b267fe15623 --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test @@ -0,0 +1,81 @@ +nextflow_process { + + name "Test Process OPENMS_IDMASSACCURACY" + script "../main.nf" + process "OPENMS_IDMASSACCURACY" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "openms" + tag "openms/idmassaccuracy" + tag "thermorawfileparser" + tag "openms/decoydatabase" + tag "openmsthirdparty/cometadapter" + + setup { + run("THERMORAWFILEPARSER") { + script "../../../thermorawfileparser/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test'], + file(params.modules_testdata_base_path + 'proteomics/msspectra/PXD012083_e005640_II.raw', checkIfExists: true) + ]) + """ + } + } + run("OPENMS_DECOYDATABASE") { + script "../../../openms/decoydatabase/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test'], + file(params.modules_testdata_base_path + 'proteomics/database/UP000005640_9606.fasta', checkIfExists: true) + ]) + """ + } + } + run("OPENMSTHIRDPARTY_COMETADAPTER") { + script "../../../openmsthirdparty/cometadapter/main.nf" + process { + """ + input[0] = THERMORAWFILEPARSER.out.spectra.join(OPENMS_DECOYDATABASE.out.decoy_fasta) + """ + } + } + } + + test("proteomics - openms - mass_error") { + when { + process { + """ + input[0] = THERMORAWFILEPARSER.out.spectra.join(OPENMSTHIRDPARTY_COMETADAPTER.out.idxml) + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("proteomics - openms - mass_error - stub") { + options "-stub" + when { + process { + """ + input[0] = THERMORAWFILEPARSER.out.spectra.join(OPENMSTHIRDPARTY_COMETADAPTER.out.idxml) + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test.snap b/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test.snap new file mode 100644 index 00000000000..9accf9a2acc --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/tests/main.nf.test.snap @@ -0,0 +1,90 @@ +{ + "proteomics - openms - mass_error - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_frag_mass_err.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_prec_mass_err.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,84212cbbf016bbcae0eb1bb0fcc30db7" + ], + "frag_err": [ + [ + { + "id": "test" + }, + "test_frag_mass_err.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "prec_err": [ + [ + { + "id": "test" + }, + "test_prec_mass_err.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,84212cbbf016bbcae0eb1bb0fcc30db7" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T05:12:06.655389198" + }, + "proteomics - openms - mass_error": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_frag_mass_err.tsv:md5,c659254bc1305edde65eca890a6cf36f" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,84212cbbf016bbcae0eb1bb0fcc30db7" + ], + "frag_err": [ + [ + { + "id": "test" + }, + "test_frag_mass_err.tsv:md5,c659254bc1305edde65eca890a6cf36f" + ] + ], + "prec_err": [ + + ], + "versions": [ + "versions.yml:md5,84212cbbf016bbcae0eb1bb0fcc30db7" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T05:11:55.087464408" + } +} \ No newline at end of file diff --git a/modules/nf-core/openms/idmassaccuracy/tests/nextflow.config b/modules/nf-core/openms/idmassaccuracy/tests/nextflow.config new file mode 100644 index 00000000000..d104b31303e --- /dev/null +++ b/modules/nf-core/openms/idmassaccuracy/tests/nextflow.config @@ -0,0 +1,27 @@ +process { + + withName:OPENMSTHIRDPARTY_COMETADAPTER { + ext.args = [ + "-instrument low_res", + "-fragment_bin_offset 0.4", + "-precursor_mass_tolerance 5", + "-precursor_error_units 'ppm'", + "-fragment_mass_tolerance 0.50025", + "-digest_mass_range '800:5000'", + "-max_variable_mods_in_peptide 1", + "-precursor_charge '2:5'", + "-activation_method 'CID'", + "-variable_modifications 'Oxidation (M)'", + "-enzyme 'unspecific cleavage'", + "-spectrum_batch_size 0" + ].join(' ').trim() + } + + withName:OPENMS_IDMASSACCURACY { + ext.args = [ + "-precursor_error_ppm", + "-fragment_mass_tolerance 0.50025" + ].join(' ').trim() + } + +} From 9ece8779e49d1e4bd836f431bc729ae4f7584dd3 Mon Sep 17 00:00:00 2001 From: Jonas Scheid Date: Mon, 16 Sep 2024 10:25:46 +0000 Subject: [PATCH 18/18] shorten version parsing --- modules/nf-core/openms/idmassaccuracy/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/openms/idmassaccuracy/main.nf b/modules/nf-core/openms/idmassaccuracy/main.nf index 5460f19996b..9759ad40919 100644 --- a/modules/nf-core/openms/idmassaccuracy/main.nf +++ b/modules/nf-core/openms/idmassaccuracy/main.nf @@ -32,7 +32,7 @@ process OPENMS_IDMASSACCURACY { cat <<-END_VERSIONS > versions.yml "${task.process}": - OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) + OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | cut -d ' ' -f 2 | cut -d '-' -f 1) END_VERSIONS """ @@ -46,7 +46,7 @@ process OPENMS_IDMASSACCURACY { cat <<-END_VERSIONS > versions.yml "${task.process}": - OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1 | cut -d '-' -f 1) + OpenMS: \$(FileInfo 2>&1 | grep -E '^Version(.*)' | cut -d ' ' -f 2 | cut -d '-' -f 1) END_VERSIONS """ }