<command interpreter="python">plotter.py $input $minsize $maxsize $factor $output</command>
<inputs>
<param name="input" type="data" format="tabular" label="Compute Plot table from this bowtie standard output"/>
<param name="minsize" type="integer" size="3" value="20" label="Min size of small RNA to plot" help="'20' = 20 nucleotides"/>
<param name="maxsize" type="integer" size="3" value="22" label="Max size of small RNA to plot" help="'22' = 22 nucleotides"/>
<param name="factor" type="float" size="6" value="1.00" label="Normalization factort" help="leave at 1.00 for no normalization"/>
<param name="title" type="text" size="15" value="Main Title" label="Main Titles"/>
<param name="xlabel" type="text" size="15" value="Coordinates (nt)" label="x axis label"/>
<param name="ylabel" type="text" size="15" value="Normalized number of reads" label="y axis label"/>
<param name="yrange" type="integer" size="6" value="400" label="y axis range"/>
</inputs>
<configfiles>
<configfile name="Rplotter">
## Setup R error handling to go to stderr
options( show.error.messages=F,
error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
tab = read.delim("${output}", header=TRUE)
## Open output PDF file
pdf( "${outputFinal}" )
#determining y and x axis ranges
MAXcoord = max(tab[,1]) + 100
MINcoord = min(tab[,1])
MMAX = ${yrange}
plot(tab[,1], tab[,2], type="h", xaxt="n", xlim=c(MINcoord , MAXcoord), ylim=c(-MMAX , MMAX), frame.plot=FALSE, lwd=2, las=2, xlab= "${xlabel}", ylab="${ylabel}", main = "${title}")
lines(tab[,1], tab[,3], type="h", lwd=2)
axis(1)
## Close the PDF file
devname = dev.off()
</configfile>
</configfiles>
<outputs>
<data name="output" format="tabular" label= "Data Frame"/>
<data name="outputFinal" format="pdf" label= "PDF plot"/>
</outputs>
but the second script output is empty. I suspect that the second script is launched when the output of the first script is not available yet.