On 08/23/2011 03:47 AM, Peter Cock wrote:
On Mon, Aug 22, 2011 at 5:29 PM, Samuel Lampa
<samuel.la...@scilifelab.uu.se>  wrote:
Hi,

I'm trying to parse the XML toolconfig format, for generating a lightweight
command config wizard in an Eclipse based product.

I wonder: Boolean parameters for some tools (such as the emboss/textsearch
one), seems to allow always giving the parameter's flag at all times, and
just change the following value between "yes" and "no" for these params,
like:

textsearch -caseinsensitive yes
  or
textsearch -caseinsensitive no

On the other hand, I guess there are many tools which tell such boolean
options just by giving the flag itself, so it would by analogy be:

textsearch -caseinsensitive
  or
textsearch

My question is, how can I see the difference between these two cases, in the
tool config file? (Unfortunately I don't know any of the wrapped tools good
enough to know where to look for a flag of the latter kind).
That will be hard - there are several ways to write such a wrapper in Galaxy.

e.g. a select showing the user text like "Case sensitive" and "Case insensitive"
with values "yes" and "no" where the cheetah template contains:

textsearch -caseinsensitive $case

Or, a boolean select where the values are again "yes" and "no" with the
same template. See for example "ntoa" in the BowTie wrapper, file:
tools/sr_mapping/bowtie_wrapper.xml

If the Unix tool expected a switch (present/absent) rather than an argument
with a value (yes/no) then you might use a select with two options "Case
sensitive" and "Case insensitive" with values "yes" and "no" where the
cheetah template contains:

textsearch
#if $case=="yes"
-caseinsensitive
#end if

Or, you might prefer to use values of "-caseinsensitive" and "" then the
cheetah becomes just:

textsearch $case

Again, the above hypothetical select parameter $case could be a boolean
parameter. e.g. See the "filter_query" option in the blastn wrapper, file
tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml

Peter

Many thanks for this info, that helps a lot!

I guess I will either need to parse the cheetah if-syntax then (have actually played with a rudimental parser in ANTLR already[1]) or just do some modifications of the tool config files, to make them work for our purposes [2]. Any other hints are of course welcome!

Cheers,
Samuel

[1] http://saml.rilspace.org/ebnf-parser-for-parts-of-the-galaxy-toolconfigs-with-antlr [2] Basically we have been prepared to need to do this anyway, since we cannot make use of wrappers using an accompanying script file, but we have assumed that the existing tool configs will be much valuable as a starting point anyway.


--
System Expert / Bioinformatician
SNIC-UPPMAX HPC Center
Uppsala University, Sweden
--------------------------------------
E-mail: samuel.la...@scilifelab.uu.se
Phone: +46 (0)18 - 471 1060
WWW: http://www.uppmax.uu.se
Uppnex: https://www.uppnex.uu.se

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

Reply via email to