Hello everyone
I'm currently developping a tool which needs as input an RData object and a variable number of tabular files, and which will return another RData object and a variable number of tabular output files (as many as the input files) so I thought the dataset collections would be an interesting feature but I have some problems.
I have no problem with the input dataset collection but concerning the output I get an empty dataset collection in my history.
I've found a fair number of examples on the Web (like here ) but some points are unclear to me.
I didn't get the difference between tool > outputs > data > discover_datasets and tool > outputs > collection > discover_datasets in the official documentation.
Concerning the "pattern" attribute, I've seen examples with
pattern="(?P<name>.*)"
or
pattern="(?P<designation>.+)\.report\.tsv"
so I don't know if I should use "name" or "designation"...
I've also seen an interesting topic here, the examples work for me but then when I tried to apply this to my code I got an empty dataset. Moreover I would prefer to use data collection. If I have 15 input files I'll have 15 output files as well and I don't want to spam my history...
Here is my xml:
<tool id="significant_regions" name="Significant regions" version="0.01">
<command><![CDATA[
Rscript --vanilla ${__tool_directory__}/significant_regions.R
--rdata ${rdata}
--merged_windows_dir ${__new_file_path__}/merged_windows_dir
]]></command>
<inputs>
<param name="rdata" format="rdata" type="data" label="--rdata" help="Input RData file (required)" />
<param name="collect_results" format="tabular" type="data_collection" collection_type="list" label="--results" help="A table or list of tables from differential analysis (required)" />
</inputs>
<outputs>
<data format="rdata" name="outr" label="output.RData" />
<collection type="list" label="${collect_results.name} merged windows collection" name="merged_windows_collection">
<discover_datasets pattern="(?P<designation>.*)\.csv" directory="${__new_file_path__}/merged_windows_dir" visible="true" />
</collection>
</outputs>
</tool>
--merged_windows_dir is the directory in which the results files will be created. If I fill this parameter with "merged_windows_dir" my results will be stored in the working directory (galaxy/database/jobs_directory/000/XXX/working/merged_windows_dir) but since it's a temporary directory, it is deleted at the end of the job and my job appears in red in the history as it cannot find the output file.
If I try with
--merged_windows_dir ${__new_file_path__}/merged_windows_dir
and
<discover_datasets [...] directory="${__new_file_path__}/merged_windows_dir"
My output files are correctly created (and still accessible after the job is finished) at galaxy/database/tmp/merged_windows_dir but I probably have a problem with the discover_datasets tag in the xml since the dataset is empty.
What did I do wrong?
Thank you for your help.