Dear Marius and all,
thanks a lot for your answer, it is indeed very interesting.
I'm following this one
https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/collection_two_paired.xmlto create an output list, starting from an input list.
The command section of my script_wrapper.xml looks like this:
<command interpreter="python">
<![CDATA[
#for $key in $input_1.keys()#
script_wrapper.py
## 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#
]]>
</command>
Once I've run the tool in galaxy the job command line looks like:
python /home/galaxy/galaxy/tools/script-collection/script_wrapper.py -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}"; script_wrapper.py -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,
Marco.