Skip to content

Commit a5ee268

Browse files
authored
Merge pull request #25 from biosustain/updt_onsite
Updt onsite
2 parents 6aa32c0 + eef2a9f commit a5ee268

File tree

5 files changed

+73
-52
lines changed

5 files changed

+73
-52
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ dag.svg
198198
testing/
199199
testing*/
200200
*.pyc
201+
.nf-test
202+
*nf.test.snap
201203

202204
# Codacy
203205
.codacy

modules/bigbio/onsite/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
name: onsite
21
channels:
32
- conda-forge
43
- bioconda

modules/bigbio/onsite/main.nf

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
process ONSITE {
2-
tag "$meta.mzml_id"
2+
tag "${meta.id}"
33
label 'process_medium'
44
label 'onsite'
55

6-
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7-
'https://depot.galaxyproject.org/singularity/pyonsite:0.0.2--pyhdfd78af_0' :
8-
'quay.io/biocontainers/pyonsite:0.0.2--pyhdfd78af_0' }"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/pyonsite:0.0.2--pyhdfd78af_0'
8+
: 'biocontainers/pyonsite:0.0.2--pyhdfd78af_0'}"
99

1010
input:
1111
tuple val(meta), path(mzml_file), path(id_file)
1212

1313
output:
14-
tuple val(meta), path("${id_file.baseName}_*.idXML"), emit: ptm_in_id_onsite
14+
tuple val(meta), path("${prefix}_*.idXML"), emit: ptm_in_id_onsite
1515
path "versions.yml", emit: versions
1616
path "*.log", emit: log
1717

18+
when:
19+
task.ext.when == null || task.ext.when
20+
1821
script:
1922
def args = task.ext.args ?: ''
20-
def prefix = task.ext.prefix ?: "${meta.mzml_id}"
23+
prefix = task.ext.prefix ?: "${meta.id}"
2124

2225
// Algorithm selection: lucxor (default), ascore, or phosphors
2326
def algorithm = params.onsite_algorithm ?: 'lucxor'
@@ -40,28 +43,31 @@ process ONSITE {
4043
if (algorithm == 'ascore') {
4144
// AScore: uses -in, -id, -out, --fragment-mass-unit
4245
fragment_unit = params.onsite_fragment_unit ?: 'Da'
43-
def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it }.join(' \\\n ')
46+
def optional_flags = [add_decoys, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ')
4447
algorithm_cmd = """
4548
onsite ascore \\
4649
-in ${mzml_file} \\
4750
-id ${id_file} \\
48-
-out ${id_file.baseName}_ascore.idXML \\
51+
-out ${prefix}_ascore.idXML \\
4952
--fragment-mass-tolerance ${fragment_tolerance} \\
5053
--fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''}
5154
"""
52-
} else if (algorithm == 'phosphors') {
55+
}
56+
else if (algorithm == 'phosphors') {
5357
// PhosphoRS: uses -in, -id, -out, --fragment-mass-unit
5458
fragment_unit = params.onsite_fragment_unit ?: 'Da'
55-
def optional_flags = [add_decoys, compute_all_scores, debug].findAll { it }.join(' \\\n ')
59+
def optional_flags = [add_decoys, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ')
5660
algorithm_cmd = """
5761
onsite phosphors \\
5862
-in ${mzml_file} \\
5963
-id ${id_file} \\
60-
-out ${id_file.baseName}_phosphors.idXML \\
64+
-out ${prefix}_phosphors.idXML \\
6165
--fragment-mass-tolerance ${fragment_tolerance} \\
6266
--fragment-mass-unit ${fragment_unit}${optional_flags ? ' \\\n ' + optional_flags : ''}
67+
${args}
6368
"""
64-
} else if (algorithm == 'lucxor') {
69+
}
70+
else if (algorithm == 'lucxor') {
6571
// LucXor: uses -in, -id, -out, --fragment-error-units (note: error-units not mass-unit)
6672
fragment_unit = params.onsite_fragment_error_units ?: 'Da'
6773
def fragment_method = params.onsite_fragment_method ?: 'CID'
@@ -81,12 +87,12 @@ process ONSITE {
8187
def decoy_mass = params.onsite_decoy_mass ? "--decoy-mass ${params.onsite_decoy_mass}" : "--decoy-mass 79.966331"
8288
def decoy_losses = params.onsite_decoy_neutral_losses ? "--decoy-neutral-losses ${params.onsite_decoy_neutral_losses}" : "--decoy-neutral-losses 'X -H3PO4 -97.97690'"
8389

84-
def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { it }.join(' \\\n ')
90+
def optional_flags = [disable_split_by_charge, compute_all_scores, debug].findAll { a -> a }.join(' \\\n ')
8591
algorithm_cmd = """
8692
onsite lucxor \\
8793
-in ${mzml_file} \\
8894
-id ${id_file} \\
89-
-out ${id_file.baseName}_lucxor.idXML \\
95+
-out ${prefix}_lucxor.idXML \\
9096
--fragment-method ${fragment_method} \\
9197
--fragment-mass-tolerance ${fragment_tolerance} \\
9298
--fragment-error-units ${fragment_unit} \\
@@ -103,16 +109,17 @@ process ONSITE {
103109
--min-num-psms-model ${min_num_psms} \\
104110
--rt-tolerance ${rt_tolerance}${optional_flags ? ' \\\n ' + optional_flags : ''}
105111
"""
106-
} else {
107-
error "Unknown onsite algorithm: ${algorithm}. Supported algorithms: ascore, phosphors, lucxor"
112+
}
113+
else {
114+
error("Unknown onsite algorithm: ${algorithm}. Supported algorithms: ascore, phosphors, lucxor")
108115
}
109116

110117
"""
111-
${algorithm_cmd.trim()} 2>&1 | tee ${id_file.baseName}_${algorithm}.log
118+
${algorithm_cmd.trim()} 2>&1 | tee ${prefix}_${algorithm}.log
112119
113120
cat <<-END_VERSIONS > versions.yml
114121
"${task.process}":
115-
onsite: \$(onsite --version 2>&1 | grep -oP 'version \\K[0-9.]+' || echo "unknown")
122+
onsite: \$(onsite --version 2>&1 | grep -oE 'version \\K[0-9.]+' || echo "unknown")
116123
algorithm: ${algorithm}
117124
END_VERSIONS
118125
"""

modules/bigbio/onsite/meta.yml

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: onsite
2-
description: Post-translational modification (PTM) localization using onsite algorithms (AScore, PhosphoRS, LucXor)
2+
description: Post-translational modification (PTM) localization using onsite
3+
algorithms (AScore, PhosphoRS, LucXor)
34
keywords:
45
- onsite
56
- PTM
@@ -18,40 +19,51 @@ tools:
1819
homepage: https://github.com/bigbio/onsite
1920
documentation: https://github.com/bigbio/onsite/blob/main/README.md
2021
tool_dev_url: https://github.com/bigbio/onsite
21-
doi: ""
22-
licence: ["MIT"]
22+
licence:
23+
- "MIT"
24+
identifier: ""
2325
input:
24-
- meta:
25-
type: map
26-
description: |
27-
Groovy Map containing sample information
28-
e.g. [ id:'test', mzml_id:'sample1' ]
29-
- mzml_file:
30-
type: file
31-
description: Input spectrum file in mzML format
32-
pattern: "*.mzML"
33-
- id_file:
34-
type: file
35-
description: Protein/peptide identifications file in idXML format
36-
pattern: "*.idXML"
26+
- - meta:
27+
type: map
28+
description: |
29+
Groovy Map containing sample information
30+
e.g. `[ id:'test', mzml_id:'sample1' ]`
31+
- mzml_file:
32+
type: file
33+
description: Input spectrum file in mzML format
34+
pattern: "*.mzML"
35+
ontologies: []
36+
- id_file:
37+
type: file
38+
description: Protein/peptide identifications file in idXML format
39+
pattern: "*.idXML"
40+
ontologies: []
3741
output:
38-
- meta:
39-
type: map
40-
description: |
41-
Groovy Map containing sample information
42-
e.g. [ id:'test', mzml_id:'sample1' ]
43-
- ptm_in_id_onsite:
44-
type: file
45-
description: Protein/peptide identifications file with PTM localization scores
46-
pattern: "*_{ascore,phosphors,lucxor}.idXML"
47-
- log:
48-
type: file
49-
description: Log file from onsite execution
50-
pattern: "*.log"
51-
- versions:
52-
type: file
53-
description: File containing software versions
54-
pattern: "versions.yml"
42+
ptm_in_id_onsite:
43+
- - meta:
44+
type: map
45+
description: |
46+
Groovy Map containing sample information
47+
- ${prefix}_*.idXML:
48+
type: file
49+
description: Output idXML file containing PTM localization results from
50+
onsite
51+
pattern: "${prefix}_*.idXML"
52+
ontologies: []
53+
log:
54+
- "*.log":
55+
type: file
56+
description: Log file from onsite execution
57+
pattern: "*.log"
58+
ontologies: []
59+
versions:
60+
- versions.yml:
61+
type: file
62+
description: File containing software versions
63+
pattern: "versions.yml"
64+
ontologies:
65+
- edam: http://edamontology.org/format_3750
5566
authors:
5667
- "@ypriverol"
5768
- "@weizhongchun"
69+
- "@enryh"

modules/bigbio/onsite/tests/main.nf.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ nextflow_process {
55
process "ONSITE"
66
tag "modules"
77
tag "modules_onsite"
8+
tag "modules_bigbio"
89
tag "onsite"
910

1011
test("Should run AScore algorithm") {

0 commit comments

Comments
 (0)