grst / nxfvars

Access nextflow variables from python scripts or notebooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sane way of writing the `.params.yml` file

grst opened this issue · comments

Currently, I generate a yaml string and inject it into the script section:

script:
"""
${nxfvars(task)}
./do_stuff.sh
"""

where the result of nxfvars is something like

return """cat <<"END_PARAMS_SECTION" > ./.params.yml\n${yaml_str}\nEND_PARAMS_SECTION\n\n"""

This results in the entire yaml file being part of .command.sh, which is 1) ugly and 2) causes issues like #6.
Ideally, we could write out the config fire directly in nxfvars(), with the code snippet from above becoming

script:
nxfvars(task)
"""
./do_stuff.sh
"""

The issue is that