/
main.nf
33 lines (26 loc) · 936 Bytes
/
main.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
process TDF2MZML {
tag "$meta.mzml_id"
label 'process_single'
label 'error_retry'
container 'docker.io/mfreitas/tdf2mzml:latest' // I don't know which stable tag to use...
input:
tuple val(meta), path(rawfile)
output:
tuple val(meta), path("*.mzML"), emit: mzmls_converted
tuple val(meta), path("*.d"), emit: dotd_files
path "versions.yml", emit: version
path "*.log", emit: log
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.mzml_id}"
"""
echo "Converting..." | tee --append ${rawfile.baseName}_conversion.log
tdf2mzml.py -i *.d 2>&1 | tee --append ${rawfile.baseName}_conversion.log
mv *.mzml ${file(rawfile.baseName).baseName}.mzML
mv *.d ${file(rawfile.baseName).baseName}.d
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tdf2mzml.py: \$(tdf2mzml.py --version)
END_VERSIONS
"""
}