On Thu, Sep 15, 2011 at 6:11 PM, Paul-Michael Agapow <Paul-Michael.Agapow@hpa.org.uk> wrote:
So one of my colleagues has a script he wants to turn into a Galaxy tool. The twist is that script:
1. Looks for files with a fixed name (e.g. “params.txt”)
2. Accepts other file names as commandline arguments, but the actual names of those files has arguments embedded in it (e.g. “nuc_100iter_b.fasta” for nucleotide data in fasta format to be run against model b for 100 iterations.)
I know, awkward and clumsy. But hardly unique for many historical bioinformatic tools. Anyway, the challenge for me is to pick the easiest path to port this script to a tool. And it seems to be fairly awkward under the Galaxy model as I understand it. Possibilities:
1. Rewrite the script argument parsing and invocation. Obviously, there will be resistance to this and with some justification (“I thought you said this could wrap any command line program …”)
If this is your own tool, this is the cleanest solution and helps beyond just using it within Galaxy.
2. Write a script that calls the original script after moving and renaming files according to desired arguments. Any problems with a two-script/executable tool like this?
That's what I'd go for - a wrapper script which takes command line arguments like a sane command line tool, and uses them to prepare the input files for the weird script. Your tool should automatically be called from a temp working directory so you can probably just make the specially named files right there, and try using links to alias the input files rather than copying them (faster as less IO).
How do I specify the interpreter for both parts of the script?
If your script is marked as executable with a suitable hash bang, it doesn't even need the Galaxy interpreter in the XML file. For the internal script it doesn't matter at all - Galaxy doesn't need to know. Peter