[galaxy-dev] Filtering number of outputs with a conditional

2013-10-31 Thread Alexandre Loywick
Hello Galaxians,

I am currently working on a tool to format reports but I have a problem
with the filter tag.

A little example is easier to figure than a long explanation so... My xml
looks like this:

tool name=My tool id=my tool
command interpreter=python$SCRIPTTYPE.SCRIPT $REPORT $SECONDPARAM
$OUTFILE $MAP/command
inputs
param type=data label=My input file name=REPORT help=Just
for the example/
conditional name=SCRIPTTYPE
param type=select label=Script to use name=SCRIPT
option value=script_x.pyX/option
option value=script_y.pyY/option
option value=script_z.pyZ/option
/param
when value=script_x.py
param type=select name=SECONDPARAM label=My
parameter
option value=foofoo/option
option value=barbar/option
/param
/when
when value=script_y.py
param type=select name=SECONDPARAM label=My
parameter
option value=AA/option
option value=BB/option
/param
/when
when value=script_z.py
param type=select name=SECONDPARAM label=My
parameter
option value=11/option
option value=22/option
/param
/when
/conditional
/inputs
outputs
data type=data format=tabular name=OUTFILE label=My
outfile
filter SCRIPTTYPE['SCRIPT'] == script_x.py/filter
/data
data type=data name=OUTFILE label=My_outfile.tgz
filter SCRIPTTYPE['SCRIPT'] == script_y.py/filter
/data
data type=data format=tabular name=OUTFILE label=My other
outfile
filter SCRIPTTYPE['SCRIPT'] == script_z.py/filter
/data
data type=data format=tabular name=MAPFILE label=My map
filter SCRIPTTYPE['SCRIPT'] == script_z.py/filter
/data
/outputs
/tool


=

I try to make my xml work that way:

When I select my script x, there is only one output labeled my outfile.
When I select my script y, there is only one output labeled My_outfile.tgz
When I select my script z, there are two outputs.

I had it working properly with just x or y, but when I add z to my xml, the
thing gets all buggy.
Instead of having one output when I select x or y, I always have two
outputs my other outfile and my map as if I had selected z.

Do you have any idea how I could solve that?

Thank you,
best regards,
Alexandre
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Filtering number of outputs with a conditional

2013-10-31 Thread Peter Cock
On Thu, Oct 31, 2013 at 10:41 AM, Alexandre Loywick a.loyw...@gmail.com wrote:
 Hello Galaxians,

 I am currently working on a tool to format reports but I have a problem with
 the filter tag.

 A little example is easier to figure than a long explanation so... My xml
 looks like this:

 ...

 Do you have any idea how I could solve that?

Personally, I would probably have three separate XML files, one
for each script. Since they are doing different jobs and producing
different sets of output that seems much clearer (and will make
life easier in the workflow editor too later on).

If there is a lot of commonality you can use macros in the XML
to avoid repeating things like input parameters.

Peter
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Filtering number of outputs with a conditional

2013-10-31 Thread Alexandre Loywick
Thank you for your fast answer Peter,

The thing is I have some constraints about this developpement and creating
multiple tools for similar processes is a bit annoying so...

I'm not really aware of macros in the xml, I'll go read the wiki again
about that.

bests,
Alexandre


2013/10/31 Peter Cock p.j.a.c...@googlemail.com

 On Thu, Oct 31, 2013 at 10:41 AM, Alexandre Loywick a.loyw...@gmail.com
 wrote:
  Hello Galaxians,
 
  I am currently working on a tool to format reports but I have a problem
 with
  the filter tag.
 
  A little example is easier to figure than a long explanation so... My xml
  looks like this:
 
  ...
 
  Do you have any idea how I could solve that?

 Personally, I would probably have three separate XML files, one
 for each script. Since they are doing different jobs and producing
 different sets of output that seems much clearer (and will make
 life easier in the workflow editor too later on).

 If there is a lot of commonality you can use macros in the XML
 to avoid repeating things like input parameters.

 Peter

___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Filtering number of outputs with a conditional

2013-10-31 Thread Peter Cock
On Thu, Oct 31, 2013 at 11:02 AM, Alexandre Loywick a.loyw...@gmail.com wrote:
 Thank you for your fast answer Peter,

 The thing is I have some constraints about this developpement and creating
 multiple tools for similar processes is a bit annoying so...

 I'm not really aware of macros in the xml, I'll go read the wiki again about
 that.

 bests,
 Alexandre

In addition to the wiki documentation, for a complex set of examples
Bjoern and John have used the macros to remove a LOT of duplication
in the BLAST+ XML files,
https://github.com/peterjc/galaxy_blast/tree/master/tools/ncbi_blast_plus

The repeated snippets are defined here:
https://github.com/peterjc/galaxy_blast/blob/master/tools/ncbi_blast_plus/ncbi_macros.xml

Note there are two kinds, XML and tokens - the tokens are new and
not yet on the wiki. They can be used inside the Cheetah syntax for
the command tag and also the RST markup for the help tag.

In a simple case (and the older BLAST+ versions) we'd just reference
the macros file from the individual tools with:

macros
importncbi_macros.xml/import
/macros

You insert the XML macros with lines like this:

expand macro=input_conditional_choose_db_type /

This is fairly easy (although it can be harder to debug).

Peter
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/