I think you could write a bash wrapper script around your tool, or if it's very 
simple, just switch from command interperter="python" to bash with command

python plotter.py variables ; r_wrapper.sh $Rplotter

using a semicolon to delineate the two commands.



Brad

On Nov 18, 2012, at 1:13 PM, Christophe Antoniewski 
<droso...@gmail.com<mailto:droso...@gmail.com>>
 wrote:

Hi,

Is there a way to pipe in the same xml wrapper two scripts in different 
languages, the output of the first script becoming the input of the second ?
I know that the spirit of galaxy would be to make a workflow, but the 
intermediate output in the present case is not interesting at all and may 
confuse the user.

I am testing something like :
        <command interpreter="python">plotter.py $input $minsize $maxsize 
$factor $output</command>
        <command interpreter="bash">r_wrapper.sh $Rplotter</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.


Thanks for the help

Chris
___________________________________________________________
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/

--
Brad Langhorst
langho...@neb.com<mailto:langho...@neb.com>





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

Reply via email to