Ok, I found the problem myself. I was totally searching in the wrong
place for the error. It was simply a syntax problem. The output
definition should be like follows:
<outputs>
<data name="output" format="bed">
<change_format>
<when input="intype.bed" value="" format="bam"/>
</change_format>
</data>
</outputs>
I was closing the data tag too early.
On 10/06/2011 11:40 AM, Sarah Diehl wrote:
Hello,
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:
<inputs>
<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>
</param>
<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>
<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."/>
</when>
</conditional>
<param name="input" type="data" format="bed" label="Input B"/>
</inputs>
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:
<outputs>
<data name="output" format="input"/>
<change_format>
<when input="intype.bed" value="" format="bam"/>
</change_format>
</outputs>
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!
Sarah
___________________________________________________________
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:
http://lists.bx.psu.edu/
___________________________________________________________
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:
http://lists.bx.psu.edu/