Ok, Great. I think I have part of this figured out. I have a conditional input as specified:
<conditional name="input_type">
<param name="input_type_selector" type="select" label="Select input type" help="Select between single and paired fastq data">
<option value="single">Single-End</option>
<option value="paired">Paired-End</option>
<option value="paired_collection">Paired Collection</option>
</param>
<when value="single">
<param name="fastq_input1" type="data" format="fastq" label="Select fastq dataset" multiple="true" help="Specify dataset with single end reads" />
</when>
<when value="paired">
<param name="fastq_input1" type="data" format="fastq" label="Select fastq dataset" help="Specify dataset with paired-end reads" />
<param name="fastq_input2" type="data" format="fastq" label="Select fastq dataset" help="Specify dataset with paired-end reads" />
</when>
<when value="paired_collection">
<param name="fastq_collection" type="data_collection" collection_type="list:paired" label="Select a paired collection" help="See help section for an explanation of dataset collections"/>
</when>
</conditional>
In my <command> section, I want to test how this is passed to the tool, so I have:
<command>
#if str( $input_type.input_type_selector ) == "single":
echo "Input Type: Single"
echo "Input File: $input_type.fastq_input1"
#elif str( $input_type.input_type_selector ) == "paired":
echo "Input Type: Paired"
echo "FastQ1: $input_type.fastq_input1\nFastQ2: $input_type.fastq_input2"
#elif str( $input_type.input_type_selector ) == "paired_collection":
print "Input Type: Collection\n"
#for $element in $input_type.$fastq_collection:
echo "FastQ1: $element.fastq_input1"
#end for
#end if
</command>
The "single" and "paired" works as expected, however I can select multiple input for "paired" which I don't want to allow. A user should only be able to select a single pair of fastq files. To select multiple pairs, I have "paired_collection".
The second problem is in the command section, I'm trying to iterated through the pair of inputs, however my echo statement is causing a Cheetah error. I tried different incarnations of it as well. My latest (and what I thought correct) is shown above. It generates the error:
Traceback (most recent call last):
File "/apps/sys/galaxy/galaxy-v15.05-staging/lib/galaxy/jobs/runners/__init__.py", line 163, in prepare_job
job_wrapper.prepare()
File "/apps/sys/galaxy/galaxy-v15.05-staging/lib/galaxy/jobs/__init__.py", line 858, in prepare
self.command_line, self.extra_filenames = tool_evaluator.build()
File "/apps/sys/galaxy/galaxy-v15.05-staging/lib/galaxy/tools/evaluation.py", line 411, in build
self.__build_command_line( )
File "/apps/sys/galaxy/galaxy-v15.05-staging/lib/galaxy/tools/evaluation.py", line 427, in __build_command_line
command_line = fill_template( command, context=param_dict )
File "/apps/sys/galaxy/galaxy-v15.05-staging/lib/galaxy/util/template.py", line 9, in fill_template
return str( Template( source=template_text, searchList=[context] ) )
File "/apps/sys/galaxy/galaxy-v15.05-staging/eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs2.egg/Cheetah/Template.py", line 1004, in __str__
return getattr(self, mainMethName)()
File "cheetah_DynamicallyCompiledCheetahTemplate_1434732603_97_56713.py", line 107, in respond
AttributeError: 'dict' object has no attribute 'VFFSL'
How do I iterate through the fastq inputs when they are passed as a list:paired?