'Galaxy local, how to display code output?

finally, I managed to load my custom tool into Galaxy. What I need is to give as input the ID of a gene and retrieve some data to be stored/displayed in a table. Now my python code is storing this table in a tab file but I’m not able to display it in Galaxy.

That’s my XML file for the tool:

<tool id="get_pheno" name="Get phenotypes" version="0.1.0">
  <description>for a gene from IMPC</description>
  <requirements>
    <requirement type="package" version="3.8">python</requirement>
    <requirement type="package" version="2.18.4">requests</requirement>
    <requirement type="package" version="0.8.9">tabulate</requirement>
    <requirement type="package" version='8.0.1'>IPython</requirement>
  </requirements>
  <command><![CDATA[python3 '${__tool_directory__}/get_pheno.py' '$input' '$output']]></command>
  <inputs>
      <param name="input" type='text' label='Input gene:'/>
  </inputs>   
  <outputs>
    <data format="tabular" name="output" label='${tool.name} on ${input}' />
  </outputs>

  <help>
This tool retrieves a list of phenotypes related to a gene entered by the user. The input must be an MGI id.
  </help>

</tool>

In my code, I'm saving the list of results in a .tab file (called 'output.tab'). If I simply print the list, I don't get the table in the results but simply the values inside the "info" box in the "edit dataset attribute" tab.

I tried substituting “data” with “output” but it’s not working, I get the error 'Unable to finish the job'.

How can I get the output as a table? I already tried to read some documentation (like this guide) but I didn’t find anything useful for me. Thank you for the help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source