Run a tool with custom parameters using Bioblend

Hello guys, please excuse my english by advance but its not my main language.

So Im trying to “invoke” or “run” a tool of my galaxy instance using the bioblend package. I’ve already tried this with a very simple tool without any problem but now im trying with a more complex tool : NCBI-blastp

Here is the error I got:

Capture d’écran 2021-05-30 à 18.09.37

from the python code:

Here im trying to get a query fasta file and a big database fasta from differents history. (everything has been uploaded successfully before), it seems to work with the query but not the database… im using those weird method “set param”, but maybe should I try it from another way?

Here is the config XML file of my tool:

edit : here is a detailed error report

Its very strange, Subject database/sequences is locked on “db”, but I’ve set the param on “file”…

I’ve try everything :’( do someone already did this with success ?

Can you check myinputs.set_param(name="database", value=' ') ? It’s the only one without a value;
In the detailed error report, CommandLine has empty value for parameter -db and Tool Standard Error is telling you need a name for you BLAST database.

Read me

PS: ton anglais est bon

Hi, thx. That “set_param(name=“database”, value=’ ')” was added by me but it doesn’t do anything. When I delete this line the same error appear.

The final tool input looks like this :
{‘query’: {‘src’: ‘hda’, ‘id’: ‘a7db2fac67043c7e’}, ‘db_opts_selector’: ‘file’, ‘subject’: {‘src’: ‘hda’, ‘id’: ‘b472e2eb553fa0d1’}, ‘blast_type’: ‘blastp’}

the database come from another history than the query_file, can this cause a problem ?

I guess it makes sense.
Did you test with a db in the same history?

Hello, I just test with the same history but still nothing.

I think I’ve found the origin of the problem, when there is a “selected” tag on “True” in an “option” tag, the param is stuck on that option. The same problem appear here with the “out_format” param which is stuck on “ext” option. The question is, can we change that with the api (without modifying the xml file) ?

Capture d’écran 2021-05-31 à 07.51.50

Capture d’écran 2021-05-31 à 07.51.38

Capture d’écran 2021-05-31 à 07.51.29

Hello, I finally did it by invoking a workflow with the tool inside instead of a tool alone, hope it will help someone in the future :slight_smile:

Capture d’écran 2021-05-31 à 15.00.06


Nice. Thanks for the detailed reports :clap: