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

--

-------------------------------------------
Matthias Bernt
Bioinformatics Service
Molekulare Systembiologie (MOLSYB)
Helmholtz-Zentrum für Umweltforschung GmbH - UFZ/
Helmholtz Centre for Environmental Research GmbH - UFZ
Permoserstraße 15, 04318 Leipzig, Germany
Phone +49 341 235 482296,
m.be...@ufz.de, www.ufz.de

Sitz der Gesellschaft/Registered Office: Leipzig
Registergericht/Registration Office: Amtsgericht Leipzig
Handelsregister Nr./Trade Register Nr.: B 4703
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: MinDirig Wilfried Kraus
Wissenschaftlicher Geschäftsführer/Scientific Managing Director:
Prof. Dr. Dr. h.c. Georg Teutsch
-------------------------------------------
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
 https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
 http://galaxyproject.org/search/

Reply via email to