Writing a tool, need wisdom on <output>
Hi, We have begun dabbling with a local instance of Galaxy (amazingly impressive !!). I have 2 questions: 1. I have written a tool to implement Lucy (http://bioinformatics.oxfordjournals.org/cgi/content/short/17/12/1093). I can figure out how to handle output when the command line has a -o option to explicitly state the output file name. Or when the file output is always the same. 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. 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 ? 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. Thank you very much for your attention, Rob Reid Rob Reid, Ph.D. | Research Associate UNC Charlotte | Dept. of Bioinformatics and Genomics 9201 University City Blvd. | Charlotte, NC 28223 Phone: 704-250-5766 rreid2@uncc.edu | http://www.uncc.edu --------------------------------------------------------------------------- If you are not the intended recipient of this transmission or a person responsible for delivering it to the intended recipient, any disclosure, copying, distribution, or other use of any of the information in this transmission is strictly prohibited.
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
participants (2)
-
James Taylor
-
Reid, Robert