Loop actions allow you to create your own type of loops. Not necessary to worry about that in the beginning as it is an advanced option and almost never needed.
No. The loop flag allows creating custom loops by using the GUI to Galaxy compiler (Comparable to Cs preprocessor for macros), but it has nothing to do with actual program logic.
Lets say you wanted to create a custom loop that allows to iterate over all characters of a given string.
1. Create a new action and check the loop and sub functions flags.
2. Add the required parameters, in this case we need the iterator (Type: Any Variable - String) and the string itself (Type: String). The iterator is a string in this case as Galaxy does not support the char data type.
3. Add a new sub function type and leave everything at default.
4. Go into the custom script part of the action definition and enter the following code. Note that all references must match the SCRIPT IDENTIFIER of the paramters and sub actions:
Does ticking Loop as an option for an action definition automatically make it loop when called? Does it mean I don't have to put while loop in there?
Whatever you do, wholeheartedly, moment by heartfelt moment, becomes a tool for the expression of your very soul.
Loop actions allow you to create your own type of loops. Not necessary to worry about that in the beginning as it is an advanced option and almost never needed.
Thanks man.
Whatever you do, wholeheartedly, moment by heartfelt moment, becomes a tool for the expression of your very soul.
@Mille25: Go
i am curious, should i flag recursive actions as loops?
No. The loop flag allows creating custom loops by using the GUI to Galaxy compiler (Comparable to Cs preprocessor for macros), but it has nothing to do with actual program logic.
@Mille25: Go
could you give an example where this might be needed?
Lets say you wanted to create a custom loop that allows to iterate over all characters of a given string.
1. Create a new action and check the loop and sub functions flags.
2. Add the required parameters, in this case we need the iterator (Type: Any Variable - String) and the string itself (Type: String). The iterator is a string in this case as Galaxy does not support the char data type.
3. Add a new sub function type and leave everything at default.
4. Go into the custom script part of the action definition and enter the following code. Note that all references must match the SCRIPT IDENTIFIER of the paramters and sub actions:
5. Test your custom loop and profit!
Output:
The custom loop will compile to Galaxy code looking similar to this: