I was actually able to solve my problem, turns out your have to execute the javascript in the response from the POST request. I guess if you use a simple html form it is automatic hence why it wasn’t stressed in the link.

On Jan 24, 2015, at 7:56 PM, Jonathan Laperle <jonathanlaperle@icloud.com> wrote:


I am trying to add a custom data source to my local galaxy following approximatly the methodology described here:


The way I went about it is :

1. Galaxy displays my website in the middle frame with a GET containing an URL and a tool_id.

2. The user selects parameters and presses a button which sends a POST request at the URL obtained at point 1. This request contains the URL to download the file and the tool_id

3. Galaxy does a GET request to the given URL and downloads the file.

For the xml file it is mostly copy-paste from the UCSC main tool except that it ends with a get rather than a post.

The communication seems to work, in fact I can see that the data is properly written to a dataset_XXX.dat file at database/files/000/ just like UCSC. Unfortunately, despite not detecting any error there seems to be an issue as the history is never updated to reflect the fact that a file was added.

By comparing the terminal output of UCSC main and my custom data source tool I noticed that the difference was the following line which is not present when I run my tool: - - [24/Jan/2015:19:17:30 -0400] "GET /api/histories/24d84bcf64116fe7/contents HTTP/1.1" 200 - "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5

This occurs right after:

galaxy.jobs.handler DEBUG 2015-01-24 19:17:30,330 (110) Dispatching to local runner

The request to the history API seems to never occur with my custom tool but I cannot figure out why.

Thank you for your help.