Hi,
I’m trying to create a javascript program to run a galaxy workflow using the API.
I run the workflow and it is executed on the history I choose,
but tools’ parameters are not set. Workflow is running only with the default parameters defined on galaxy web interface during workflow creation.
My code where I call the API is:
setWorkflowParams()
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
};
let dict = {};
dict['workflow_id'] = 'f2db41e1ad331c3e';
dict['history'] = 'hist_id=df6a1e0b02a5d08e';
dict['parameters'] = params;
return this.http.post(URL_GALAXY + '/api/workflows?key=' + API_KEY, dict, httpOptions);
And this is the code where I set the parameters dictionary on the variable params:
setWorkflowParams() {
let dictSarra = {};
dictSarra['paramSolo_0|profRaiz'] = 0.5;
dictSarra['paramSolo_0|reserva'] = 70;
dictSarra['paramSolo_1|profRaiz'] = 0.5;
dictSarra['paramSolo_1|reserva'] = 110;
dictSarra['paramSolo_2|profRaiz'] = 0.5;
dictSarra['paramSolo_2|reserva'] = 150;
dictSarra['cult'] = 20;
let dictCSV = {};
dictCSV['fases'] = ['1','2'];
let dictInter = {};
dictInter['riscos'] = ['80','70','60','50'];
let dictArea = {};
dictArea['cortef1'] = 0.6;
dictArea['cortef2'] = 0.5;
dictArea['cortef3'] = 1.0;
dictArea['cortef4'] = 1.0;
let dictClass = {};
dictClass['corteArea'] = 0.3;
let dictParams = {};
dictParams['0'] = dictSarra;
dictParams['1'] = dictCSV;
dictParams['2'] = dictInter;
dictParams['3'] = dictArea;
dictParams['4'] = dictClass;
this.params = dictParams;
}
My workflow has five steps (tools). I have searched the galaxy documentation and I’ve found this explanation only:
“parameters (dict) – If workflow_id is set - see _update_step_parameters()”
No further explanation is available on the code also. I’ve found these two links where it shows how to build the parameter “params”, which is the way I implemented the code in setWorkflowParams():
https://bioblend.readthedocs.io/en/latest/api_docs/galaxy/all.html#bioblend.galaxy.workflows.WorkflowClient.invoke_workflow
https://www.mail-archive.com/galaxy-dev@lists.bx.psu.edu/msg15083.html
Here is my params in JSON format, which I guess it follows the specification I found on those links:
{"0":{"paramSolo_0|profRaiz":0.5,"paramSolo_0|reserva":70,"paramSolo_1|profRaiz":0.5,"paramSolo_1|reserva":110,"paramSolo_2|profRaiz":0.5,"paramSolo_2|reserva":150,"cult":20},"1":{"fases":["1","2"]},"2":{"riscos":["80","70","60","50"]},"3":{"cortef1":0.6,"cortef2":0.5,"cortef3":1,"cortef4":1},"4":{"corteArea":0.3}}
But that doesn’t work. Any ideas? Thanks.