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?



On Fri, Jun 19, 2015 at 11:31 AM, John Chilton <jmchil...@gmail.com> wrote:

> The option in the GUI for selecting multiple datasets for a single
> data parameter - causes multiple jobs to be created as you noted. If
> you just place multiple="true" on your data input parameter  - that
> button will go away and all the datasets will be used for a single
> job.
>
> If your tool consumes pairs of datasets - you will want to expose an
> option where you are using a parameter like:
>
> <input name="input_pairs" type="data_collection"
> collection_type="list:paired" format="fastq" />
>
> and then your users will have to use the data collection creator to
> pair off the datasets into a big list before using your tool - but the
> creator is actually really nice - I think it makes it very easy to
> build large lists of pairs.
>
> Hope this helps - happy to provide more details,
> -John
>
> On Fri, Jun 19, 2015 at 11:24 AM, Ryan G <ngsbioinformat...@gmail.com>
> wrote:
> > Hi all - I have a tool which is essentially an entire NGS pipeline
> bundled
> > into a perl script and associated modules.  I'd like to offer this tool
> to
> > users via Galaxy.
> >
> > I'm trying to pass a bunch of fastq files to the tool, but noticed that
> > operating on multiple datasets creates a separate job for each dataset.
> I
> > want to pass all the datasets to the tool so only one galaxy job is
> actually
> > created.  Is this possible, and if so, how do I go about doing this?
> >
> > Ryan
> >
> >
> > ___________________________________________________________
> > 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/mailinglists/
>
___________________________________________________________
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/mailinglists/

Reply via email to