Using the python bioblend package to send my job into Galaxy, I have an error when I try to send a value depending of a conditional argument.
In my XML file, I have this conditional argument in my <inputs></inputs>
(without the _help_ and _label_ parameters) :
<conditional name="metagenomes_format">
<param name="meta_format" type="select">
<option value="fastq" selected="true">fastq</option>
<option value="solid">solid</option>
</param>
<when value="fastq">
<param name="inputfastq" type="data" format="fastq" multiple="false">
</when>
<when value="solid">
<param name="inputcsfasta" type="data" multiple="false" format="txt"/>
<param name="inputqual" type="data" multiple="false" format="txt"/>
</when>
</conditional>
I can start jobs from Galaxy so I imagine that my problem is coming from the bioblend package.
I run my job with this :
# The metagenome format has to be solid or fastq
format = "solid"
# Connection to the Galaxy server
user = GalaxyInstance(url="GALAXY_IP", key="user_api_key")
# Data to send to Galaxy
data = {
"meta_format":format,
... other input parameters ...
}
# Adding the fastq or solid file to use in the Data to send
if format="fastq":
data["metagenomes_format|inputfastq"]={"src":"hda", "id":"the fastq file id"}
else:
data["metagenomes_format|inputcsfasta"]={"src":"hda", "id":"the csfasta file id"}
data["metagenomes_format|inputqual"]={"src":"hda", "id":"the qual file id"}
# Sending the job to Galaxy
user.tools.run_tool(
"history id",
"my_software",
data
)
I can send job using the _fastq_ format but not when using _solid_ as argument. Galaxy return me a problem with the fastq file format (that I don't use with solid data). The error 400 message :
"metagenomes_format|inputfastq": "History does not include a dataset of the required format / build"
And the traceback :
File "[...]/galaxy/web/framework/decorators.py", line 257, in decorator
rval = func( self, trans, *args, **kwargs)
File "[...]/galaxy/api/tools.py", line 262, in create\
vars = tool.handle_input( trans, incoming, history=target_history )
File "[...]/galaxy/tools/__init__.py", line 1123, in handle_input
raise exceptions.MessageException( ', '.join( [ msg for msg in all_errors[ 0 ].itervalues() ] ), err_data=all_errors[ 0 ] )
MessageException: History does not include a dataset of the required format / build
Have I an error in the definition of my XML file or with my python code? Or is it a bug from the galaxy API/bioblend?