Accessing Galaxy using the API
While Galaxy's main use case is via an easy-to-use web interface, it also provides a REST API for programmatic access. There are interfaces provided in several languages, for example, Python support is available from BioBlend (https://bioblend.readthedocs.io).
Here, we are going to develop a script that will load a BED file into Galaxy and call a tool to convert it to GFF format. We will load the file via Galaxy's FTP server.
Getting ready
If you did not go through the previous recipe, please read its There's more... section. The code was tested in a local server, as prepared in the preceding recipe, but it might require some adaptations if you run it against a public server.
Our code will need to authenticate itself against the Galaxy server in order to perform the necessary operations. Because security is an important issue, this recipe will not be totally naive with regards to it. Our script will be configured via a YAML file, for example:
rest_protocol: http...