Hi all,

I've just uploaded a simple sequence composition tool to the
Test Tool Shed:


This accepts multiple input in FASTA, FASTQ, or SFF format -
and allows a mixture of these:

    <param name="input_file" type="data" format="fasta,fastq,sff"
multiple="true" label="Sequence file" help="FASTA, FASTQ, or SFF
format." />

In order to build the command line string, I am currently using this
for loop:

<command interpreter="python">
seq_composition.py -o "$output_file"
##For loop over inputs
#for i in $input_file
--$i.ext "${i}"
#end for

This results in things like this being run:

seq_composition.py -o XXX.dat --fastqsanger XXX.dat --sff XXX.dat

This works, but means my Python script has to know about not just
the core data types that I specified in my input parameter XML
(fasta,fastq,sff) but also any subclasses (e.g. fastqsanger).

It seems what I want/need would be something along these lines
in pseudo-code to map any datatype which is a subclass for fastq
to use a single command line option:

<command interpreter="python">
seq_composition.py -o "$output_file"
##For loop over inputs
#for i in $input_file
#if isinstance($i.datatype, fastq):
--fastq "${i}"
--$i.ext "${i}"
#end if
#end for

This mock example borrows from the Python isinstance function,
but of course some Galaxy datatypes are defined as subclasses
at the XML level rather than literally at the Python class level.

This should result in getting the following regardless of which
flavour of FASTQ the input dataset had assigned:

seq_composition.py -o XXX.dat --fastq XXX.dat --sff XXX.dat

Does anyone have any Tool XML examples probing an input file's
datatype in this way?

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:

To search Galaxy mailing lists use the unified search at:

Reply via email to