Excerpts from Reid, Robert's message of Tue Aug 17 15:41:42 +0000 2010:
I am trying to make a tool where the java executable is launched and
makes an output file. The output file is named the same as the input
file (input.txt) but has a new extension added to the end of it
(.cal),
i.e., inputfilename.txt.cal
I can't for the life of me figure out the XML syntax to read this file
back into galaxy as an output.
There is currently no XML config syntax for supporting tools which do
not allow specifying the output name. However, there definitely should
be...
Is the best strategy to write a wrapper in another language (perl,
python, java), that will feed in $output, then read in the ".cal"
output and spew out a file to satisfy $output for the XML ?
This is what we currently do. It is usually enough for the wrapper to mv
the output to the correct filename -- Galaxy does not keep a handle to
the old file with that name or anything. This can be pretty simple, a
shell script may do:
#!/bin/sh
# First argument -- $1 -- is the input file, tool writes output to
# $1.cal, the second argument -- $2 -- is where Galaxy wants output
java -jar /path/to/TheRealUnderlyingTool.jar $1 && mv $1.cal $2
Assuming your tool is well behaved enough to return a good exit status.
You may need more than one line if not ;)
2. For testing, what is the best way to do the testing? I have
written a few java based executable jars and the corresponding XML
docs to go with them. I'd like to share with the world but I am not
sure the best way to go testing.
You can include unit tests in your XML file (<tests>) element. You can
then upload your tools to
http://community.g2.bx.psu.edu
Thanks,
James