Question: Use paired collection on wrapper
0
gravatar for benoit.valot
4 months ago by
benoit.valot0 wrote:

Hi,

I'm try to write a wrapper for a tool that performed subsampling of fastq file. The script is also able to handle paired-end files. My problem is to run on paired collection.

See the input parameter

    <conditional name="fastq" >
  <param name="choice" type="select" label="Type of reads to subsampling" help="" >
    <option value="choice1" selected="true">Single</option>
    <option value="choice2">Paired (separated)</option>
    <option value="choice3">Paired</option>
  </param>
  <when value="choice1">
    <param name="single" type="data" format="fastq,fastq.gz"
           label="Single read file" help="Fastq(gz) format" />
  </when>
  <when value="choice2">
    <param name="forward" type="data" format="fastq,fastq.gz"
           label="Forward read file" help="Fastq(gz) format" />
    <param name="reverse" type="data" format="fastq,fastq.gz"
           label="Reverse read file" help="Fastq(gz) format" />
  </when>
  <when value="choice3">
    <param name="pairedfile" type="data_collection" format="fastq,fastq.gz"
           label="Paired of read files" help="Fastq(gz) format"
           collection_type="paired" />
  </when>
</conditional>

And the command line:

    #if $fastq.choice == "choice3"
  #if $fastq.pairedfile
    -r '${fastq.pairedfile.forward}'
    -l '${fastq.pairedfile.reverse}'
  #end if 
#end if

When I run the wrapper, I got the following message:

Error executing tool: Paired instance must define 'forward' and 'reverse' datasets .

I have look at other tools like bwa-mem that use also paired collection, but don't see where is the problem in my code.

Thanks in advance

Benoit

software error galaxy • 164 views
ADD COMMENTlink modified 4 months ago • written 4 months ago by benoit.valot0
0
gravatar for benoit.valot
4 months ago by
benoit.valot0 wrote:

I finnaly found the problem.

It was not related to the input, but to the output collection. Name of dataset must be forward and reverse as follow:

    <collection name="paired_output" type="paired"
            label="${tool.name} on ${fastq.pairedfile.name}">
  <data name="forward" format="fastqsanger.gz"
        from_work_dir="1.fastq.gz">
  </data>
  <data name="reverse" format="fastqsanger.gz"
        from_work_dir="2.fastq.gz">
  </data>
  <filter>fastq['choice'] == "choice3"</filter>
</collection>
ADD COMMENTlink written 4 months ago by benoit.valot0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 176 users visited in the last hour