Hi Saba and Jens, ":" are not needed, they are optional, see http://www.cheetahtemplate.org/docs/users_guide_html/users_guide.html#SECTIO... Maybe it's a problem with the left quotes around Use_Snapshot in the #if line? Nicola Il 2014-03-20 06:26 Keilwagen, Jens ha scritto:
Hi Saba,
there is a syntax error in the line of the "#if". Please add ":" at the end and report whether the error still occurs.
All the best, Jens
VON: galaxy-dev-bounces@lists.bx.psu.edu [mailto:galaxy-dev-bounces@lists.bx.psu.edu] IM AUFTRAG VON Saba Sehrish GESENDET: Mittwoch, 19. März 2014 23:07 AN: galaxy-dev@lists.bx.psu.edu BETREFF: [galaxy-dev] Running a different command based on selection in the tool
Hi all,
I am trying to write a tool that based on user criteria will run a different script.
In the code below, If I select Use_Snapshot, I see the right interface but somehow galaxy tries to execute the #else part and look for "m" input parameter. The example I have seen in documentation is using the script with same name in both if and else and the number of input arguments is the same as well. Any suggestions/ideas why always #else part gets executed although right interface appears based on user selection.
Thanks,
Saba
<command>
#if $source.source_select=="Use_Snapshot"
cM-snapshot.sh $input $output
#else
cM.sh $m $b $ns $w $s $z $output
#end if
</command>
<inputs>
<conditional name="source">
<param name="source_select" type="select" label="Specify the input">
<option value="Use_Snapshot">Use Snapshot</option>
<option value="Set_Values">Set Values</option>
</param>
<when value="Use_Snapshot">
<param name="input" type="data" format="dbm" size="100" label="Input Snapshot"/>
<sanitizer sanitize="False"/>
</when>
<when value="Set_Values">
<param name="m" label="Omega_m h^2" type="float" value="0.1279" min="0.120" max="0.155"/>
<param name="b" label="Omega_b h^2" type="float" value="0.0232" min="0.0215" max="0.0235"/>
<param name="ns" label="n_s" type="float" value="0.8629" min="0.85" max="1.05"/>
<param name="w" label="w" type="float" value="-1.184" min="-1.30" max="-0.70"/>
<param name="s" label="sigma_8" type="float" value="0.6159" min="0.61" max="0.9"/>
<param name="z" label="z" type="float" value="1.0" min="0.0" max="1.0"/>
<sanitizer sanitize="False"/>
</when>
</conditional>
</inputs>