Hi Ed,
I tried your provided xml file, and your provided change_format tag worked to change the
output datatype from fasta to qual454 when intype.sel is set to Qual454. It is worth
noting that support of grouping constructs (including conditionals) was added in changeset
3472:bfcf6a3249c7 (beginning of March), so you may need to update your Galaxy source code.
There was a separate bug concerning the use of repeat grouping constructs and
change_format tags or output data label templates in a tool causing a server error (e.g.
'TypeError: <galaxy.tools.SelectToolParameterWrapper object at 0x5f105d0> is not
JSON serializable') which has been fixed in changeset 3609:23fb19105d96 that would
affect your tool when a 'Filter' element was declared. Let us know if you
encounter further issues when using the latest revision.
Thanks for using Galaxy,
Dan
On Mar 30, 2010, at 8:42 PM, Edward Kirton wrote:
hi, how do i reference conditional variables from within the
change_format tag? i couldn't find any examples that did this. an
example tool config xml file follows.
thanks!
ed kirton
us doe jgi
<tool id="fasta_get_seqs" name="Get Sequences">
<description>Create a Fasta/Qual file of selected sequences</description>
<command interpreter="perl">fasta_get_seqs.pl $intype.infile
$input_table $id_column $ignorecase $cosorted $output
#for $i in $filters
"${i.condition} ${i.column} ${i.value}"
#end for
</command>
<inputs>
<conditional name='intype'>
<param name='sel' type='select' label='Input file
type'>
<option value='Fasta'>Fasta</option>
<option value='Qual454'>Qual454</option>
</param>
<when value='Fasta'>
<param name="infile" type="data"
format="fasta" label="Fasta file"/>
</when>
<when value='Qual454'>
<param name="infile" type="data"
format="qual454"
label="Qual454 file"/>
</when>
</conditional>
<param name="input_table" type="data"
format="tabular" label="File
containing target IDs"/>
<param name='id_column' type='data_column'
data_ref='input_table'
label='Column containing sequence IDs'/>
<param name='ignorecase' type='boolean' truevalue='1'
falsevalue='0' label='Ignore case?' />
<param name="cosorted" type="boolean" checked="true"
truevalue='1'
falsevalue='0' label='Sequences appear in same order in both files'/>
<repeat name='filters' title='Filter'>
<param name='condition' type='select'
label='Condition'>
<option value='s_eq'>text equals</option>
<option value='s_ne'>text not equals</option>
<option value='s_contains'>text contains</option>
<option value='s_startswith'>text starts with</option>
<option value='s_endswith'>text ends with</option>
<option value='n_eq'>number ==</option>
<option value='n_ne'>number !=</option>
<option value='n_gt'>number ></option>
<option value='n_lt'>number <</option>
</param>
<param name='column' type='data_column'
data_ref='input_table'
label='On column'/>
<param name='value' type='text' label='Value'/>
</repeat>
</inputs>
<outputs>
<data name="output" format="fasta">
<change_format>
<when input="intype.sel" value="Qual454"
format="qual454" />
</change_format>
</data>
</outputs>
<help>
**What it does**
Produces a Fasta/Qual file of selected sequences.
If the files are cosorted, a much faster algorithm is used. If it
fails, it assumes the files were not cosorted and automatically tries
again
using the slower algorithm which does not require cosorted files.
One or more filters may be included to evaluate text (equal, not
equal, contains, starts with) or numeric data (==, !=, >, <).
</help>
</tool>
_______________________________________________
galaxy-dev mailing list
galaxy-dev(a)lists.bx.psu.edu
http://lists.bx.psu.edu/listinfo/galaxy-dev