Skip to content

Commit b2a4dbb

Browse files
Christoph JansenChristoph Jansen
Christoph Jansen
authored and
Christoph Jansen
committed
generate-red-and-job.py
1 parent f828c8f commit b2a4dbb

File tree

3 files changed

+130
-84
lines changed

3 files changed

+130
-84
lines changed

generate-red-and-job.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env python3
2+
3+
from ruamel.yaml import YAML
4+
5+
yaml = YAML(typ='safe')
6+
7+
8+
INPUT_DIR_LISTING = [{
9+
'class': 'Directory',
10+
'basename': 'datasets',
11+
'listing': [{
12+
'class': 'File',
13+
'basename': 'lfq_spikein_dilution_1.mzML'
14+
}, {
15+
'class': 'File',
16+
'basename': 'lfq_spikein_dilution_2.mzML'
17+
}, {
18+
'class': 'File',
19+
'basename': 'lfq_spikein_dilution_3.mzML'
20+
}]
21+
}, {
22+
'class': 'Directory',
23+
'basename': 'databases',
24+
'listing': [{
25+
'class': 'File',
26+
'basename': 's_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta'
27+
}, {
28+
'class': 'File',
29+
'basename': 's_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.phr'
30+
}, {
31+
'class': 'File',
32+
'basename': 's_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.pin'
33+
}, {
34+
'class': 'File',
35+
'basename': 's_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.psq'
36+
}, {
37+
'class': 'File',
38+
'basename': 'uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta'
39+
}, {
40+
'class': 'File',
41+
'basename': 'uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.phr'
42+
}, {
43+
'class': 'File',
44+
'basename': 'uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.pin'
45+
}, {
46+
'class': 'File',
47+
'basename': 'uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.psq'
48+
}]
49+
}]
50+
51+
DATABASE_NAME = 's_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta'
52+
53+
54+
with open('knime-labelfree-quantification.cwl.yml') as f:
55+
cwl = yaml.load(f)
56+
57+
docker_image_url = cwl['requirements']['DockerRequirement']['dockerPull']
58+
59+
del cwl['requirements']
60+
61+
62+
red = {
63+
'redVersion': '7',
64+
'cli': cwl,
65+
'inputs': {
66+
'input_dir': {
67+
'class': 'Directory',
68+
'connector': {
69+
'command': 'red-connector-http-archive',
70+
'access': {
71+
'url': 'https://s3.denbi.uni-tuebingen.de/fb-test/demo_container/cibi_user_meeting_2018/labelfree_example.tar.gz',
72+
'archiveFormat': 'gztar'
73+
}
74+
},
75+
'listing': INPUT_DIR_LISTING
76+
},
77+
'database_name': DATABASE_NAME
78+
},
79+
'container': {
80+
'engine': 'docker',
81+
'settings': {
82+
'image': {
83+
'url': docker_image_url
84+
}
85+
}
86+
}
87+
}
88+
89+
job = {
90+
'input_dir': {
91+
'class': 'Directory',
92+
'location': 'labelfree_example',
93+
'listing': INPUT_DIR_LISTING
94+
},
95+
'database_name': DATABASE_NAME
96+
}
97+
98+
with open('knime-labelfree-quantification.red.yml', 'w') as f:
99+
yaml.dump(red, f)
100+
101+
with open('job.yml', 'w') as f:
102+
yaml.dump(job, f)
103+

generate-red.py

Lines changed: 0 additions & 81 deletions
This file was deleted.

job.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1+
database_name: s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta
12
input_dir:
2-
class: "Directory"
3-
location: "labelfree_example"
4-
database_name: "s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta"
3+
class: Directory
4+
listing:
5+
- basename: datasets
6+
class: Directory
7+
listing:
8+
- {basename: lfq_spikein_dilution_1.mzML, class: File}
9+
- {basename: lfq_spikein_dilution_2.mzML, class: File}
10+
- {basename: lfq_spikein_dilution_3.mzML, class: File}
11+
- basename: databases
12+
class: Directory
13+
listing:
14+
- {basename: s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta, class: File}
15+
- {basename: s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.phr,
16+
class: File}
17+
- {basename: s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.pin,
18+
class: File}
19+
- {basename: s_pyo_sf370_potato_human_target_decoy_with_contaminants.fasta.psq,
20+
class: File}
21+
- {basename: uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta, class: File}
22+
- {basename: uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.phr,
23+
class: File}
24+
- {basename: uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.pin,
25+
class: File}
26+
- {basename: uniprot-s-pyogenes-sf370-plus-potato-and-human-spike-ins.fasta.psq,
27+
class: File}
28+
location: labelfree_example

0 commit comments

Comments
 (0)