sorry my bad: the last data format before filter should be of course tabular and not fasta. Alex ________________________________________ Van: galaxy-dev-bounces@lists.bx.psu.edu [galaxy-dev-bounces@lists.bx.psu.edu] namens Bossers, Alex [Alex.Bossers@wur.nl] Verzonden: dinsdag 19 oktober 2010 22:23 Aan: zhe@lanl.gov CC: galaxy-dev@bx.psu.edu Onderwerp: Re: [galaxy-dev] Dynamic output format I think you can only use the metadata_source if the param outputFormat would be of type data and get an actual file. You also don't have INPUT defined. So for your situation I think a slight alteration in the options as written by Kelly should work; See the * marked lines that changed. There are more options to do it but the FILTER is most simple. Needless to say you also need the upper id and cmd part of the XML to get it working.... Alex <inputs> * <param name="input" type="data" format="fasta" label="input FastA" /> <param name="outputFormat" type="select" label="Select output format"> <option value="fasta" selected="true">Fasta</option> <option value="table">Table</option> </param> </inputs> <outputs> * <data name="output" format="fasta" > * <filter>outputFormat=="fasta"</filter> * </data> * <data name="output" format="fasta" > * <filter>outputFormat=="table" > * </data> </outputs> ________________________________________ Van: Zhe Chen [zhe@lanl.gov] Verzonden: dinsdag 19 oktober 2010 18:29 Aan: Bossers, Alex Onderwerp: RE: [galaxy-dev] Dynamic output format I try to change it to <inputs> <param name="outputFormat" type="select" label="Select output format"> <option value="fasta" selected="true">Fasta</option> <option value="table">Table</option> </param> </inputs> <outputs> <data name="output" format="input" metadata_source="outputFormat"/> </outputs> It gives me an error.
Yes, A simple example is in the filter/sorter.xml and pasteWrapper tool_config. Basically by the metadata_source in sorter:
<outputs> <data format="input" name="out_file1" metadata_source="input"/> </outputs>
A format example in the tools/filter/pasteWrapper.xml where you use conditionals:
<outputs> <data format="input" name="out_file1" metadata_source="input1"> <change_format> <when input_dataset="input1" attribute="ext" value="bed" format="interval"/> </change_format> </data> </outputs>
Hope this helped,
Alex
-----Oorspronkelijk bericht----- Van: galaxy-dev-bounces@lists.bx.psu.edu [mailto:galaxy-dev-bounces@lists.bx.psu.edu] Namens Zhe Chen Verzonden: dinsdag 19 oktober 2010 0:48 Aan: galaxy-dev@bx.psu.edu Onderwerp: [galaxy-dev] Dynamic output format
Hi,
Can the format of a tool's "output" be dynamic according to the user's input?
See example below, when user chose fasta, let the output format be fasta, when user choose table, let the output format be tabular.
<input> <param name="outputFormat" type="select" label="Select output format"> <option value="fasta" selected="true">Fasta</option> <option value="table">Table</option> <option value="mase">Mase/IG</option> <option value="pretty">Pretty print</option> <option value="outali">Output aligned</option> <option value="clustal">Clustal</option> <option value="phylipi">Phylip interleaved</option> <option value="phylips">Phylip sequential</option> <option value="msf">MSF</option> <option value="rsf">RSF</option> <option value="megai">MEGA interleaved</option> <option value="megas">MEGA sequential</option> <option value="slx">SLX</option> <option value="gde">GDE</option> <option value="GDEFlat">GDEflat</option> <option value="stockholm">Stockholm</option> <option value="nexusi">Nexus interleaved</option> <option value="nexuss">Nexus sequential</option> <option value="pir">PIR/NBRF</option> <option value="gcg">GCG</option> <option value="raw">Raw</option> </param> </input>
<outputs> <data name="output" format="tabular"/> </outputs>
Thanks _______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev