Galaxy API

In addition to being accessible through a web interface, Galaxy can also be accessed programmatically, through shell scripts and other programs. The web interface is appropriate for things like exploratory analysis, visualization, construction of workflows, and rerunning workflows on new datasets.

The web interface is less suitable for things like:

  • Connecting a Galaxy instance directly to your sequencer and running workflows whenever data is ready
  • Running a workflow against multiple datasets (which can be done with the web interface, but is tedious)
  • When the analysis involves complex control, such as looping and branching.

The Galaxy API addresses these and other situations by exposing Galaxy internals through an additional interface, known as an Applications Programming Interface, or API.

Enabling

To use the API, you must first generate an API Key for the account you want to access Galaxy from. Please note that this key acts as an alternate means to access your account, and should be treated with the same care as your login password. You can do so in the UI under user preferences (while logged in).

Alternatively You can retrieve your API key by sending baseauth GET request to /api/authenticate/baseauth

Working with API

Programming Language Bindings

Various language specific libraries for interfacing with the Galaxy API have been developed by the Galaxy community:

Examples

Code

Many examples and API utility scripts are shipped with Galaxy and BioBlend. You can browse them here and here respectively.

Open Source Projects

HTTP Methods

HTTP methods correspond to operations in Galaxy. Operations are implemented as standalone scripts (in scripts/api/) and as routines in scripts/api/common.py.

HTTP Method common.py Routine Standalone
GET display() display.py
PUT update() update.py
POST submit() create.py
DELETE delete() delete.py

Galaxy's API behind a proxy

You have to make sure that the API calls are passing through the proxy by adding the following lines to the Apache config file:

 <Location "/api">
     Satisfy Any
     Allow from all
 </Location>

Replace /api with /api/galaxy when serving Galaxy at a sub directory (such as /galaxy/).