Question: Naming output file according to input file
1
gravatar for Rob
23 months ago by
Rob50
France
Rob50 wrote:

Hello,

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 • 805 views
ADD COMMENTlink modified 23 months ago • written 23 months 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 23 months ago by Bjoern Gruening4.8k

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 23 months ago • written 23 months ago by Rob50

The true command seem to be :

<data name="output1" label="${input1.name}.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 23 months 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 23 months 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 23 months ago by Rob50
Please log in to add an answer.

Help
Access

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