Dear Marius and all,

thanks a lot for your answer, it is indeed very interesting.

I'm following this one
to create an output list, starting from an input list.

The command section of my script_wrapper.xml looks like this:

  <command interpreter="python">
      #for $key in $input_1.keys()#

        ## Input list BAM file
        -i $input_1[$key]

        ## Reference file
        -f "${reference}"

        ## Output file
        -1 "$output[$key]"

        ## Set number of threads
        -t "\${GALAXY_SLOTS:-4}";

      #end for#

Once I've run the tool in galaxy the job command line looks like:

python /home/galaxy/galaxy/tools/script-collection/ -i /home/galaxy/galaxy/database/files/000/dataset_269.dat -f "/home/galaxy/galaxy/database/files/000/dataset_256.dat" -1 "/home/galaxy/galaxy/database/files/000/dataset_312.dat" -t "${GALAXY_SLOTS:-4}"; -i /home/galaxy/galaxy/database/files/000/dataset_254.dat -f "/home/galaxy/galaxy/database/files/000/dataset_256.dat" -1 "/home/galaxy/galaxy/database/files/000/dataset_313.dat" -t "${GALAXY_SLOTS:-4}";

And the output looks fine only for the first command in the job comman line, becasue "python" is called only at the first iteration of the for cycle.

Is there a way to prevent this behaviour or some "best practices" ?

Thanks a lot,

2016-06-07 14:05 GMT+02:00 Marius van den Beek <>:
Hi Marco,

you've got an interesting use-case there.
You may want to use either a dataset list (if you only supply rna_n.bam),
or a paired dataset list (rna_n.bam and dna_n.bam). 
I would probably implement a conditional, where the user selects either a dataset list or a paired dataset list.
The output would then be another collection of output files.
Have a look at the test tool folder, and see if any of the tools named collection_*.xml fits what you would like to do
These two may be a good basis for what you want to achieve:
[this one creates an output collection]
[this one has a conditional to either select a list or a paired list as input]

Let us know if you need more help!


On 7 June 2016 at 09:50, Marco Tangaro <> wrote:
Dear experts,
my name is Marco and I'm working to port our python tool to the Galaxy framework.
The main script needs a rna.bam file as input, a reference fasta file, both mandatory. Finally, you can add a dna.bam file, but this is optional.
Therefore an example command is: -i rna.bam -f reference.fa -j dna.bam

The outout is a tabular.
Again the -j dna.bam option is completely optional.
So quite soon it turned out that I had to use a python wrapper to parse our script. Now the wrapper works fine.

The next step is to run the tool over multiple input file and we would like to avoid to use a workflow.

The idea is that to each input file corresponds an output file. The reference is still the same.
For instance, we have:

rna_1.bam + dna_1.bam -> output_1.txt
rna_2.bam + dna_2.bam -> output_2.txt
rna_3.bam + dna_3.bam -> output_3.txt
and so on.

But I don't know the best strategy to give to my wrapper multiple input files.
Moreover I have to be sure, when the dna_xyz.bam files are uploaded, that they correspond to the right rna_xyz.bam file.

I would like to have as output a page which is showing as results the link to the single output files as suggested here.
planning to integrate a javascript interface.

I've browsed a lot, but on multiple input file the posts are old.
I'm using the last galaxy release (16_04).

I'm quite new to the galaxy world...
Thanks a lot for your suggestions,

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: