Commit 6c70e050 authored by Marc's avatar Marc
Browse files

BUGFIX: config is now loaded while parameter functions are executed, not in...

BUGFIX: config is now loaded while parameter functions are executed, not in the main function anymore; helper scripts are executed in the nextflow script without full path, it was made use of the bin folder in the execution directory
parent 6d5d44ae
......@@ -40,16 +40,17 @@ def main():
args = parser.parse_args()
args.parser = parser
config = load_config(arguments=args)
args.func(args, config)
args.func(args)
def help(args, config):
def help(args):
args.parser.print_help()
def info(args, config):
def info(args):
config = load_config()
show_analyses(config)
def analyze(args, config):
def analyze(args):
config = load_config(arguments=args)
if not os.path.isfile(args.fasta):
print("Given fasta file does not exist")
sys.exit(1)
......@@ -75,7 +76,6 @@ def generate_execution(config, args):
execution['fasta'] = os.path.abspath(args.fasta)
execution['output'] = os.path.abspath(args.output)
execution['install_path'] = config['install_path']
execution['helpers_path'] = config['helpers_path']
execution['database_path'] = config['databases']['localpath']
execution['docker'] = args.docker
execution['singularity'] = args.singularity
......@@ -134,7 +134,7 @@ def show_analyses(config):
def download_databases(execution):
script = execution['helpers_path'] + '/download_databases_from_s3bucket.sh'
script = execution['install_path'] + '/helpers/download_databases_from_s3bucket.sh'
logfile = execution['install_path'] + '/database_paths.log'
database_path = execution['database_path']
......
......@@ -29,7 +29,7 @@ process normalizing_fasta {
script:
"""
${helpers_path}/reduce_fasta_headers_to_enumeration.py -f $$fasta -e $${fasta.baseName}_enum_headers.tsv
reduce_fasta_headers_to_enumeration.py -f $$fasta -e $${fasta.baseName}_enum_headers.tsv
"""
}
''')
......@@ -93,7 +93,7 @@ process ${id}_restore_headers_json {
script:
"""
${helpers_path}/restore_seq_id_from_enumeration.py -j $$result -e $$headers
restore_seq_id_from_enumeration.py -j $$result -e $$headers
"""
}
''')
......@@ -125,7 +125,7 @@ process ${id}_restore_headers_json {
script:
"""
${helpers_path}/restore_seq_id_from_enumeration.py -j $$result -e $$headers
restore_seq_id_from_enumeration.py -j $$result -e $$headers
"""
}
''')
......@@ -157,7 +157,7 @@ process ${id}_restore_headers_json {
script:
"""
${helpers_path}/restore_seq_id_from_enumeration.py -j $$result -e $$headers
restore_seq_id_from_enumeration.py -j $$result -e $$headers
"""
}
''')
......@@ -300,7 +300,6 @@ def generate_nextflow_script(execution):
for m in modules:
config = flatten(m)
config['output'] = execution['output']
config['helpers_path'] = execution['helpers_path']
command = Template("""${analysis_script} --fasta '$$fasta' --output '$${fasta}.${id}.results' ${analysis_params}""").substitute(config)
cmdline = subprocess.run(command, shell=True, stdout=subprocess.PIPE)
......
Markdown is supported
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