|
| 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 | + |
0 commit comments