Hi, I have a hopefully quick question. If I have a...
# nostupidquestions
r
Hi, I have a hopefully quick question. If I have a large bash script inside my process, is there a way I can have it in a separate
.sh
file and call it from the script, or directly import the script instead of the
script
block?
a
Well you can use
template
(docs) but the template function is generally advised against as noted in the docs. Alternatively you could put it in your pipeline
bin
and then run
my script.sh
in the
script
block. If you are using
wave
you could also put it in a module binary
i
If you put the script in the bin folder, make it executable and add a shebang, your process should automatically find it and be able to run it
r
Thanks! The
bin
folder in the module? Is that added to the
PATH
variable?
i
I currently only have one bin folder at the project root and that's automatically added to the PATH and I can imagine it would be the same for a bin folder in the module directory. I am still figuring out nf-core best practice
a
The pipeline
bin
is top level (alongside the pipeline
main.nf
) and "just works" (automatically added to path and exposed to processes/modules). A
bin
at the module level is covered by the module binaries link in my first response and (unfortunately imo) only works if you are using
wave
currently
r
Thanks! Unfortunately, we are not using wave yet. But thanks for the suggestions 🙂
p
Module binaries work without wave when not using a cloud executor.
👍 2