Commit eb487842 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Added support for parameters

parent 23f7e3bd
......@@ -72,8 +72,21 @@ def generate_execution_modules_for_profile(config, profile):
# generate unique ids for each module
for module in modules:
module['id'] = module['name']
module['params'] = generate_params_string(p['modules'][module['name']])
return modules
def generate_params_string(options):
params = ''
if options:
l = []
for k in options:
if options[k]:
l.append('--' + k + " '" + options[k] + "'")
else:
l.append('--' + k)
params = ' '.join(l)
return params
def generate_nextflow_script(modules):
fragments = []
......@@ -83,7 +96,6 @@ Channel.fromPath(params.fasta).set{fasta}''')
fragments.append('fasta.into{'+';'.join(target_channels)+';}')
from string import Template
# TODO add parameters to analysis_script
analysis_template = Template ('''
process ${id} {
input:
......@@ -94,7 +106,7 @@ process ${id} {
script:
"""
${analysis_script} --fasta $$fasta --output $${fasta}.${id}.results
${analysis_script} --fasta $$fasta --output $${fasta}.${id}.results ${params}
"""
}
''')
......
......@@ -5,16 +5,18 @@ profiles:
- name: 'fast'
info: 'Profile that contains tools that give a fast result'
modules:
- signalp
signalp:
organism: 'euk'
- name: 'common'
info: 'Profile that uses commonly used tools'
modules:
- signalp
- blastp_swissprot
signalp:
blastp_swissprot:
alignment:
- name: 'complete'
info: 'Profile that uses all available tools'
modules:
- signalp
- blastp_swissprot
signalp:
blastp_swissprot:
- name: 'custom'
info: 'Define which tools should be run'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment