Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/bigbio/onsite/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::pyonsite=0.0.4
- bioconda::pyonsite=0.0.5
18 changes: 12 additions & 6 deletions modules/bigbio/onsite/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
path "versions.yml", emit: versions
path "*.log", emit: log

Expand All @@ -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.name.endsWith(".idparquet")
? "idparquet"
: id_file.name.endsWith(".idXML")
? "idXML"
: id_file.name.endsWith(".mzIdentML")
? "mzIdentML" : "idparquet"

// Build algorithm-specific command
def algorithm_cmd = ''
Expand All @@ -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 : ''}
"""
Expand All @@ -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}
Expand Down Expand Up @@ -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} \\
Expand Down
8 changes: 4 additions & 4 deletions modules/bigbio/onsite/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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":
Expand Down
81 changes: 81 additions & 0 deletions modules/bigbio/onsite/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions tests/config/test_data.config
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading