I'm trying to write a wrapper for the intersectBed tool from the BEDTools suite. The difficulty lies in the possible combinations of input and output data formats. Input can be either bed or bam. When the input is bed, the output is also bed. However, when the input is bam the output can be either bam (default) or bed (by an additional command-line switch). I cannot figure out how to dynamically set the output format correctly. The wrapper always fails in at least one of the three cases.

I collect the input as follows:

<conditional name="intype">
<param name="inselect" type="select" label="Select input file type">
<option value="bed" selected="true">BED, GFF</option>
<option value="bam">BAM</option>
<when value="bed">
<param name="inputBed" type="data" format="bed,gff" label="Input A" help="Each feature in A is compared to B in search of overlaps."/>
<when value="bam">
<param name="inputBam" type="data" format="bam" label="Input A" help="Each BAM alignment in A is compared to B in search of overlaps."/> <param name="bed" type="boolean" truevalue="-bed" falsevalue="" checked="False" label="Write output as BED" help="The default is to write output in BAM when using BAM as input."/>

<param name="input" type="data" format="bed" label="Input B"/>

I really want to keep the conditional and the select, because the program behaves slightly different depending on the input format.

I tried to define the output like that:

<data name="output" format="input"/>
<when input="intype.bed" value="" format="bam"/>

However, this fails when the input is bam and I want a bed output. I tried many different things I found in the wiki and on the mailing list, but nothing worked properly. I'm grateful for any ideas how to solve this problem. Thanks for your help in advance!

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:


Reply via email to