bgruening / galaxytools

:microscope::books: Galaxy Tool wrappers
MIT License
115 stars 220 forks source link

Add header #1375

Closed Marie59 closed 4 months ago

Marie59 commented 5 months ago

Hi @bgruening I want to add the header of the columns when selecting them for this tool. Do you think that's okay ?

bgruening commented 5 months ago

I guess so. But lets ask @nsoranzo and @bernt-matthias as well.

bernt-matthias commented 5 months ago

A good idea. Also cool to see this attribute (I never stumbled over it so far).

But I have 1 concern (and a suggestion).

The main problem is that the input does not always has a header. For input without header the select will probably become unusable. Actually we can not even assume that the input is tabular (input has format data).

My suggestion would be to add a conditional that allow the user to specify if the data has a header or not and only use the attribute if the user has selected yes.

Marie59 commented 5 months ago

Is this what you were thinking of @bernt-matthias ? (I tested it locally it seems to be working fine)

nsoranzo commented 5 months ago

The main problem is that the input does not always has a header. For input without header the select will probably become unusable. Actually we can not even assume that the input is tabular (input has format data).

Actually the input format is txt, which makes me think that we should probably drop the -b (bytes) option (try to run cut -b on a text file with non-ASCII characters, it makes a mess).

Another issue is that the delimiter (-d) can only be specified when using -f (fields), e.g.:

$ cut -c 1,3-5 -d "," test.txt 
cut: an input delimiter may be specified only when operating on fields

So the delimiter param should be moved inside <when value="-f">.

bernt-matthias commented 5 months ago

Is this what you were thinking of @bernt-matthias ? (I tested it locally it seems to be working fine)

Excellent

Another issue is that the delimiter (-d) can only be specified when using -f (fields)

I just did this.

we should probably drop the -b (bytes) option

Feel free to do so.

Marie59 commented 5 months ago

And thanks to you @bernt-matthias !

bgruening commented 4 months ago

Can you please look at https://github.com/bgruening/galaxytools/pull/1385 we will work on this PR as a general update.

Thanks!