This is a complete beginner question and this probably belongs to the RTFM section. However, there is obviously a logic that I do not understand in galaxy xml.
What I want to do (independently of whether or not you can do that with existing tools in galaxy), is to give a list of bed files to my tool, and output a tab like:
#filename #nb of lines file1 4645464 ... ...... filen 346354345
Here is my xml file:
<tool id="bedcounts_summary" name="Counts and summarizes line number for each bed file of a list" version="0.1.0"> <requirements> </requirements> <command> bash $__tool_directory__/bedcounts_summary.sh #for $key in $bedlist.keys() # $key $bedlist[$key] #end for >> $outputtab </command> <inputs> <param type="data_collection" format="bed" name="bedlist"/> </inputs> <outputs> <data name="outputtab" format="tabular"/> </outputs> <help><![CDATA[ TODO: Fill in help. ]]></help> </tool>
Here is the bash script:
#!/bin/bash bedfilename=$1 bedfile=$2 countslines=`wc -l < $bedfile` echo -e "$bedfilename\t$countslines"
This is returning only the first line. I managed to have all lines using a simple echo but that is not the point, obviously.
If you can point to my logic/programming error that would be very helpful!