Question: Use paired collection on wrapper
    
    0
        
benoit.valot • 0 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
