How to construct input dict when running a tool in Galaxy externally through API?

Hi!

I am trying to run skesa (a NGS assembler) in a Galaxy instance through API ([bioblend.galaxy.GalaxyInstance.ToolClient.run_tool()])(API documentation for interacting with Galaxy — BioBlend 1.5.0 documentation) in python code. I am using a paired fastq in one of my histories. My code looks like:

my_history = my_galaxy_instance.histories.get_histories()
tool_client = ToolClient(my_galaxy_instance)
tool_id = “toolshed.g2.bx.psu.edu/repos/cstrittmatter/skesa/skesa/0.24”
skesa_input = {
“fastq”: {
“id”: “56a201aaf82840b5”, #id of the paired fastq
“src”: “hdca”
}
}
result_skesa = tool_client.run_tool(my_history[0][“id”], tool_id, skesa_input)

I want to use all default settings for skesa. The command for skesa would be: “skesa -fastq forward_read_file,reverse_read_file”. The format of “skesa_input” seems incompatible with my Galaxy instance. What would be the correct format for “skesa_input”? Thank you.

Welcome @yuwang

This tool wrapper has somewhat poor documentation! The tool shed repository doesn’t point to a valid tool development repository (the NCBI is here GitHub - ncbi/SKESA: SKESA assembler).

However, you can find this in your Galaxy server on the tool form. Under the Options menu is the option View Tool Source which presents the tool.xml or you can click into See in Tool Shed then browse the tip files.

You will need to use the conditional/legacy format if I am understanding this correctly. This is needed to inform the tool that you are supplying a pair in a collection format and to set the outputs correctly. Please be aware that the wrapper xml was last updated in 2019 and might not interact with modern Galaxy systems correctly but I assume you have run this through the history already and are just working on the API part now.

Hope this helps! :slight_smile: