Question: Bioblend error for conditional input
0
gravatar for Thibaut Guirimand
2.2 years ago by
INRA
Thibaut Guirimand • 50 wrote:

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?

input bioblend galaxy python • 751 views
ADD COMMENT • link • modified 2.2 years ago • written 2.2 years ago by Thibaut Guirimand • 50
1
gravatar for Thibaut Guirimand
2.2 years ago by
INRA
Thibaut Guirimand • 50 wrote:

It seems to be a bug with the selected="true" as parameter of my selected <option></option>. When I send a query using the second option, the galaxy API seems to keep the default value as the selected parameter...

<conditional name="metagenomes_format">
    <param name="meta_format">
        <!--option value="fastq" selected="true">fastq</option-->
        <option value="fastq" >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>

My second error was to using meta_format instead of metagenomes_format|meta_format.

ADD COMMENT • link written 2.2 years ago by Thibaut Guirimand • 50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 172 users visited in the last hour