Hi all,
I am trying to pass a non-dataset parameter in toolClient.run_tool.
More specifically, I am running the following code.
from bioblend.galaxy import GalaxyInstance
from bioblend.galaxy.histories import HistoryClient
from bioblend.galaxy.tools import ToolClient
from bioblend.galaxy.datasets import DatasetClient
galaxyInstance = GalaxyInstance(url=GALAXY_URL, key=API_KEY)
historyClient = HistoryClient(galaxyInstance)
toolClient = ToolClient(galaxyInstance)
datasetClient = DatasetClient(galaxyInstance)
history = historyClient.create_history('tmp')
testFile = toolClient.upload_file(PATH_NAME, history['id'], type='txt')
params = {'param': 'cond.choice', 'value': 'yes','cond.test_file':{'src': 'hda', 'id': testFile['outputs'][0]['id']}}
output = toolClient.run_tool(history_id=history['id'], tool_id=TOOL_ID, tool_inputs=params)
I am using the following xml file in Galaxy server:
<tool id="CondTest_R" name="CondTest" version="1.1.0">
<description>Makes a conditional test</description>
<command interpreter="Rscript">CondTest.R $out_file1 ${cond.choice} ${cond.te$
<inputs>
<conditional name="cond">
<param name="choice" type="select" label="Do you want to read numbers fro$
<option value="no">no</option>
<option value="yes">yes</option>
</param>
<when value="no">
<param name="test_file" type="hidden" value="NULL"/>
</when>
<when value="yes">
<param name="test_file" type="data" format="txt" label="Test file"/>
</when>
</conditional>
</inputs>
.
.
.
</tool>
This does not work properly - I see from Galaxy server log that 'cond.choice' gets 'no' but I assign 'yes' to it in params = {...}.
I am pretty sure I am doing the parameters setting incorrectly in params = {...} since I have tested this tool works properly when I run it directly from Galaxy server's web interface.
Does anyone have an idea what I am doing incorrectly in the parameters settings?
In other words, what is the correct way to assign a non-dataset parameter in toolClient.run_tool?
To me it seems the documentation of toolClient.run_tool in http://bioblend.readthedocs.org/en/latest/api_docs/galaxy/all.html is not very informative but from the documentation of run_workflow I got a hint that it could work something like what I am using it in the code above.
Thanks in advance,
Erno Lindfors