Passing variable as argument for splitFasta() #3388
-
Hi! I am facing a similar issue as #1702, but for a the splitFasta() operator. I wish to split a multifasta in 12 pieces that each contain roughly the same amount of sequences. Eg. if I have a multifasta with 184 sequences I want to split this into 12 files with each 16 sequences. I first tried to do this using this code:
but this caused the issue: I have tried different solutions mentioned in #1702. Both .val and .getValue() make my workflow freeze. FriederikeHanssen mentioned that she fixed the issue for groupTuple by using the map operator (#1702 (comment)), I tried to do the same for splitFasta().
This code runs without issues but instead of splitting in 12 pieces it splits into one file for each sequence, even though num_fasta seems to contain the right value. Is there some kind of workaround for this? Or should I handle this in a different way? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Unfortunately, this cannot be done. Operator arguments cannot be dataflow variables |
Beta Was this translation helpful? Give feedback.
-
As an alternative you could add a process to split the FASTA file. |
Beta Was this translation helpful? Give feedback.
As an alternative you could add a process to split the FASTA file.
E.g. using https://bioinf.shenwei.me/seqkit/usage/#split