As I mentioned in my previous post, I am a part of a team for work on a project. This project is centered around a single FOSS Project. We have selected Galaxy as the project we are going to use.
Galaxy is probably one of the best choices for this project for a multitude of reasons. For starters, I am not completely unfamiliar with Galaxy as I know some of the inner-workings. Most of the implementing done in Galaxy is through the use of Python and XML. Galaxy, on a local instance, makes calls to a machine's terminal (or command line) through "tools", a term Galaxy has coined.
These tools are merely abstractions of Python files.
The XML is used as a way to set up the abstracted, user interface that Galaxy produces. All of the inputs, text fields, dropdown boxes, checkboxes, etc. are formatted through the XML. The XML file also has a reference to the Python file that will be run. Lastly, the XML has a listing of the command-line arguments. For example, if after the Python file name if you wanted to have an input, then you would put that input right next to the Python file name (space-separated, as command-line arguments always are). Below, I will detail a full example of a small XML file:
<command interpreter="python"> example.py $input1 $input3 -z "$results" $putin</command>
<inputs>
<param name="input1" size ="4" value="1054" type="integer" label="Number Input"/>
<param name="input3" type="integer" label="A Second Number Input"/>
<param name="putin" type="select" display="radio" label="Select One">
<option value="option1">This One</option>
<option value="2option">Or This One</option>
</param>
</inputs>
<outputs>
<data format="csv" name="results" from_work_dir="results.csv" label="CSV Results"/>
</outputs>
<tests>
<test>
</test>
</tests>
<help>
</help>
So, as you can see, this is a very flexible system. As long as your python file is the first argument in the command interpreter, then you are fine. I used different input names following the call (names do not matter, but usually there's a convention created for readability). The parameters are pretty self explanatory: 2 Integer inputs and a Radio button selection. The values produced from this are indexed by their command line argument. So getting the first integer would be as simple as going to sys.argv[1] (as the filename for the python file is at [0]). Radio button values take on either "option1" or "2option" in this case, even though the GUI presents them as "This One" and "Or This One".
One functionality I do not know much about, but will become increasingly important for this project, is the test(s) area of the XML file. Hopefully this is where I can specify all test cases that need to pass in order for a tool to be 'functional'.
Considering all things, Galaxy may seem convoluted at first, but it is a very useful project for various uses. It can be extended to really do anything as it merely makes command line calls. So with Galaxy, the galaxy's the limit.
Music listened to while blogging: Travis Barker, Notorious B.I.G.
No comments:
Post a Comment