Skip to content
Snippets Groups Projects
Commit 0ef7a504 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Fix bug: convert_targetp still has problems when installed in a virtualenv

parent 8c34e904
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ analysis_template = Template ('''
process ${id} {
executor '${executor}'
${clusterOptions}
${beforeScript}
input:
file fasta from for_${id}${chunks}
......@@ -50,6 +51,7 @@ process generate_${id}_live_results {
''')
convert_live_template = Template ('''
process convert_${id}_to_json {
${beforeScript}
input:
file result from ${id}_results
......@@ -64,6 +66,7 @@ process convert_${id}_to_json {
''')
convert_info_template = Template ('''
process convert_${id}_to_json {
${beforeScript}
input:
file result from ${id}_results
......@@ -78,6 +81,7 @@ process convert_${id}_to_json {
''')
convert_template = Template ('''
process convert_${id}_to_json {
${beforeScript}
input:
file result from ${id}_results
......@@ -92,6 +96,7 @@ process convert_${id}_to_json {
''')
retrieve_informations_template = Template('''
process retrieve_informations_for_${id} {
${beforeScript}
input:
file result from ${id}_json_info
......@@ -107,6 +112,7 @@ process retrieve_informations_for_${id} {
''')
retrieve_informations_live_template = Template('''
process retrieve_informations_for_${id} {
${beforeScript}
input:
file result from ${id}_json_info
......@@ -187,12 +193,16 @@ Channel.fromPath(params.fasta).set{fasta}''')
for m in modules:
config = flatten(m)
config['output'] = execution['output']
if 'venv' in execution:
config['beforeScript'] = "beforeScript 'export PS1=; source " + execution['venv'] + "/bin/activate'"
else:
config['beforeScript'] = ''
if execution['use_cluster']:
config['executor'] = 'sge'
config['chunks'] = ".splitFasta(by:300, file:'input')"
config['clusterOptions'] = "clusterOptions='-S /bin/bash'"
if 'venv' in execution:
config['clusterOptions'] = config['clusterOptions'] + "\nbeforeScript 'export PS1=; source " + execution['venv'] + "/bin/activate'"
else:
config['executor'] = 'local'
config['chunks'] = ''
......@@ -200,21 +210,17 @@ Channel.fromPath(params.fasta).set{fasta}''')
fragments.append(analysis_template.substitute(config))
if execution['mode'] == 'live' and not execution['fetch_informations']:
fragments.append(convert_live_template.substitute(flatten(m)))
copy = deepcopy(m)
copy['output'] = execution['output']
fragments.append(live_results_template.substitute(flatten(copy)))
fragments.append(convert_live_template.substitute(config))
fragments.append(live_results_template.substitute(config))
elif execution['mode'] == 'live' and execution['fetch_informations']:
fragments.append(convert_info_template.substitute(flatten(m)))
fragments.append(retrieve_informations_live_template.substitute(flatten(m)))
copy = deepcopy(m)
copy['output'] = execution['output']
fragments.append(live_results_template.substitute(flatten(copy)))
fragments.append(convert_info_template.substitute(config))
fragments.append(retrieve_informations_live_template.substitute(config))
fragments.append(live_results_template.substitute(config))
elif execution['mode'] == 'complete' and execution['fetch_informations']:
fragments.append(convert_info_template.substitute(flatten(m)))
fragments.append(retrieve_informations_template.substitute(flatten(m)))
fragments.append(convert_info_template.substitute(config))
fragments.append(retrieve_informations_template.substitute(config))
else:
fragments.append(convert_template.substitute(flatten(m)))
fragments.append(convert_template.substitute(config))
json_inputs = []
for m in modules:
......
#!/usr/bin/python3
#!/usr/bin/env python3
import sys
import json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment