Define variable inside template script to be used later in the same script. #4008
Unanswered
waltergallegog
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hello, Can you try the following? process svValCute {
input:
path sv_ref
output:
path '*vcf'
shell:
template 'sv_val.sh'
}
and then: sv_ref_gz="!{sv_ref}.gz"
bgzip -c $sv_ref > $sv_ref_gz
tabix -f -p vcf $sv_ref_gz
some_python_script.py --sv $sv_ref_gz ... |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using the following template:
which is called from a process:
In the template, in the first line, I'm defining the variable
sv_ref_gz
. I want to reference this new variable in the next 3 commands.The template works when referencing the variable with
\$
, as it is a bash variable. But according to the documentation at https://www.nextflow.io/docs/latest/process.html#template, this is not a good practice, because the\$
will not be evaluated correctly when running from a terminal.Is there a way I can use this variable so that:
Using
$sv_ref_gz
gives me the following error when running from nextflow:Thanks for the support,
Walter
Beta Was this translation helpful? Give feedback.
All reactions