New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bash external script: is it possibile to use it #294
Comments
I must use mailing list, I'm closing it |
Hi @aborruso , what came out of this? I'm quite keen on this feature too! |
hi @bricoletc this is for you https://groups.google.com/d/msg/snakemake/Nv9tzlgeqNE/KzoZro1yBQAJ |
Thanks for your reply @aborruso ! I'm a little confused by that answer. Have you successfully called bash scripts from Here's what I get when running the following snakefile:
where the bash script contains:
Stderr:
|
I have not tested, I'm sorry.
Please write a reply in the mailing list
…______
Scusami per la brevità, ti sto scrivendo dal cellulare.
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E EPSG:4326
Il gio 16 apr 2020, 20:37 Brice Letcher <notifications@github.com> ha
scritto:
Thanks for your reply @aborruso <https://github.com/aborruso> !
I'm a little confused by that answer. Have you successfully called bash
scripts from script directive inside a rule?
Here's what I get when running the following snakefile:
rule mkfiles:
params:
pref="test"
script:
"mkfiles.sh"
where the bash script contains:
for i in $(seq 1 5); do
echo {snakemake.params.pref}$i
done
Stderr:
ValueError in line 5 of /path/to/tests/Snakefile:
Unsupported script: Expecting either Python (.py), R (.R), RMarkdown (.Rmd) or Julia (.jl) script.
File "/path/to/tests/Snakefile", line 5, in __rule_mkfiles
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHPDZ3T3ZJ4L2AZRCGAZLRM5F5RANCNFSM4LTULAFA>
.
|
I think this is worth re-examining then. Is lack of support for shell script because it is hard to implement, or for design reasons? |
I think this is doable. Since Bash v4, there are associative arrays, which are analogous to python dictionaries. There is a nice tutorial here showing how to work with these. The main task for getting this working I expect is converting a python dictionary to a bash dictionary. I couldn't find any (obvious) existing libraries for this, but we could easily write a sublibrary within snakemake to do this conversion and then inject it into the bash script. I'd be happy to dig into this once #1053 is merged (and provided @johanneskoester is happy to include such a feature). |
Hi,
I think it's not possible, but it would be great to use something like
echo ${input[1]}
in an external bash script.Thank you for this great tool
The text was updated successfully, but these errors were encountered: