Download Multiple Files -- Custom tool development: Writing outputs to the user history as datasets

I am new to Galaxy. I developed a tool wherein I am storing the output (multiple files) of the tool after it finishes running into a directory which I create during runtime (the directory name has the following format: <system_time_in_milliseconds>_<random_5_digit_number>).

Now my main aim is, how can I get the name of the directory created during runtime in my XML code. Also, how can I set the output of the tool in the XML file to point to the contents of the directory.

I did look into the documentation, the tag has an attribute from_work_dir, can you please provide me with an example of how to use this.

My XML File Looks like this:

<tool id="tool1" name="tool1" version="1.0.0">
    <command detect_errors="exit_code"><![CDATA[
    python3 $__tool_directory__/ $input1 -s $input1 -m GTRGAMMA -f d -N 500
    <param type="data" format="data" name="input1" label="Input file"/>
    <data name="output1" from_work_dir="<don't know what to put here>"/>

1 Like

Hi @Saahil_Anil_Chawande,

Since Galaxy will launch every single job in a dedicate working directory, why do you need to name your directory like this?

By the way, if you need to get several files from a directory, I can advice you to look at this:
Or if you aren’t interesting in Dataset Collection.

1 Like