Hi all,

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

https://testtoolshed.g2.bx.psu.edu/view/peterjc/seq_composition
https://github.com/peterjc/pico_galaxy/commit/45669446f5a14fd90a8a0d9d7430499de2fb3493

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

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

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

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}"
#else
--$i.ext "${i}"
#end if
#end for
</command>

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?

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/

Reply via email to