Dynamic declaration of array size and accessing array job variables within script #5849
Unanswered
banilmohammed
asked this question in
Q&A
Replies: 1 comment 8 replies
-
You just need to escape the dollar sign in the script block: As for dynamic array size, it is not allowed on a per-task basis because that wouldn't make any sense. But you could still set it using a param: array params.array_size The closure is needed only when you want to use task inputs. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Im trying to write a process which runs a script that I want to submit as an array job to my cluster running
SGE
. Prior to using nextflow I have created a submission script that defines resources and includes the commands to run. Something akin to this:Running this script with
qsub submission.sh
gets me what I want, however I have been porting this pipeline over to nextflow and struggling to get similar functionality. Currently I have my process set up as the following:This currently doesn't work as nextflow tells me there is no defined variable called
SGE_TASK_ID
.I have 2 questions:
In regards to 1. I looked through the following thread #1477 (comment), where there seems to be references to
SGE_TASK_ID
however I can't seem to access that variable. In regards to 2., I have tried to dynamically allocate array size with a closure like:array { array_size }
, however get an error message saying that the array directive cannot be declared in dynamic manner with a closure. If this is currently supported, I welcome any ideas as a workaround.Thank you all
Beta Was this translation helpful? Give feedback.
All reactions