Dear list,
in a tool I want to process a set of (bam) files. For the convenience of the user I thought that it would be nice to allow collections as well as manually selected files (in a param with multiple=true). Like so:
``` <conditional name="input_type"> <param name="input_type_selector" type="select" label="BAM files"> <option value="list">data set list</option> <option value="manual">data sets</option> </param> <when value="manual"> <param name="input_bam" format="bam" type="data" multiple="true" optional="false" label="BAM files" /> </when> <when value="list"> <param name="input_bam" format="bam" type="data_collection" collection_type="list" label="BAM files" /> </when> </conditional> ```
Is there a way to get the number of data sets in both cases (in the collection or selection) in a consistent way?
Currently the only way I found is:
``` #if $input_type.input_type_selector == 'manual': #set count = len($input_type.input_bam) #else #set count = len($input_type.input_bam.keys()) #end if ```
Appart from this looping works like a charm:
``` #for $bam in $input_type.input_bam: OPERATIONS... #end for ```
Cheers, Matthias
galaxy-dev@lists.galaxyproject.org