How should I store files using original file names and extensions when I upload them

I am developing a new galaxy tool using R as main programming language.

When I upload a number of txt files with the Upload tool in Get Data, I noticed that it stores the files in galaxy/database/files/000 directory and changes the file names from the originalname.txt into dataset_number .dat. How can I set up Upload tool in order to store the file with the originalname.txt format.

Thank you very much in advance for your help.

1 Like

This isn’t possible, Galaxy may store files in object stores that don’t resemble classical file systems.
The correct way is to reference files in your tool using $file.element_identifier.


Thank you for your response.

My problem is that the R package I am using to develop the tool requires a set of filenames and a location of the files and it generates an ExpressionSet based on those files. If the filenames in the file directory are different from the original once I don’t know how to tell to the function what file to integrate.

Could you suggest me a solution?

Thank you

1 Like

You can symlink this in your command section to a known location. This is a very common pattern in Galaxy tools. So ln -s $file or something like that, and then use in your tool. If the name is important you can use ln -s '$file' '${re.sub('[^\w\-_]', '_', $file.element_identifier)'.tab


Thank you mvdbeek,
I tried to add the command you suggested in the command tag of my tool.xml file and it works if I run it for one file. However, if I iterate the command to create a symlink for 4 files using a for statement the loop stucks. I did not find any example showing the application of loops in the command statement. That’s could be the cause?

This is my code:

for ( i=1; i<=4; i++ ); do
  ln -s '${ARRAY[$i]}' '${ARRAY[$i]}.element_identifier';

Thank you for your precious help

1 Like

The language in the <command/> tag is cheetah, there are many examples in the documentation, one is here.
The documentation is pretty dense, you might want to follow along the planemo tutorial first ( and specifically


Thank you for your precious help!!!

I resolved the issue as follows:

#for $input in $LIST
ln -sf '$input' '$__tool_directory__/Symlink/${input.element_identifier}';
#end for


Have a nice day