Question: Naming output file according to input file
gravatar for Rob
2.1 years ago by
Rob50 wrote:


I currently develop a galaxy tool and I want to remove the extension from my input file. For example, if my input file is "myfile.bam", I want to return a file named "myfile.something".

I would like to do something like that :

<data name="output1" label="${input}.something"/>

But I don't know how to remove the .bam extension, just how to add other things after it.. How can I do that ?

tool dev galaxy • 888 views
ADD COMMENTlink modified 2.1 years ago • written 2.1 years ago by Rob50
If ${input} is a data parameter it will never have the .bam ending. It will have a .dat ending. Just set the format="sam" and Galaxy and all users will know it's a SAM file.
ADD REPLYlink written 2.1 years ago by Bjoern Gruening4.9k

Hi, thanks for your answer.

That the point. (you're right my example was wrong, sorry, I will correct that, but it show what I want to do) but by input file I mean the user file, witch is a .bam. And I want to rename my output file by myself, cause in fact the soft doesn't product an extension recognize by Galaxy, and so I can't use the format attribute.

So what I want is to take the input file name (smth.bam) remove the .bam extension and add something other (.aaa or what you want) for the output.

(I have updated my post a little bit cause it wasn't really explicit)

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by Rob50

The true command seem to be :

<data name="output1" label="${}.something">

It return myInputFile.bam.something, but it's not what I want, do you have an idea for remove the .bam ?

ADD REPLYlink written 2.1 years ago by Rob50

The data tag takes a format attribute. Then it doesn't matter what file extension the results happen to have.

ADD REPLYlink written 2.1 years ago by Devon Ryan1.9k

Okay, but the format attribute doesn't modify the output file name.

So I guess it's impossible to work on the name itself. Since my input file format is not recognized by Galaxy, I am then condemned to keep this extension in my output file name..

Thanks for your answers.

ADD REPLYlink written 2.1 years ago by Rob50
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 70 users visited in the last hour