This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pxd2qc.nf
81 lines (62 loc) · 1.52 KB
/
pxd2qc.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env nextflow
params.input = "PXD0123"
params.out = "./result.txt"
process fetchURLS {
container 'quay.io/mwalzer/prideapiclient:latest'
output:
file "*" into urls
script:
"""
pride_api_client -p '${params.input}'
"""
}
process downloadFiles {
container 'quay.io/mwalzer/prideapiclient:latest'
input:
file myurl from urls.flatten()
output:
file '*.raw' into rawFiles
script:
"""
#!/usr/bin/env python
import wget
with open('${myurl}') as f:
urls = f.readlines()
[wget.download(url) for url in urls]
"""
}
process convertRawFile {
container 'quay.io/mwalzer/thermorawfileparser:master'
input:
file rawFile from rawFiles
output:
file '*.json' into metaResults
file '*.mzML' into fileinfo_datasets
script:
"""
mono /src/bin/x64/Debug/ThermoRawFileParser.exe -i=${rawFile} -m=0 -f=1 -o=./
"""
}
/*
* mzml to tsv
*/
process openmsFileInfo {
container 'mwalzer/openms-batteries-included:V2.3.0_pepxmlpatch'
cpus 1
input:
file new_mzML from fileinfo_datasets
output:
file "${new_mzML.baseName}.txt" into fileinfo_results
"""
FileInfo \
-in $new_mzML \
-out ${new_mzML.baseName}.txt
"""
}
/*
* Collects all the fileinfos into a single file
* and prints the resulting file content when complete
*/
fileinfo_results
.collectFile(name: params.out)
.println { file -> "FileInfo for the given files:\n ${file.text}" }