galaxytools icon indicating copy to clipboard operation
galaxytools copied to clipboard

Cut tool: ability to rearrange and duplicate columns?

Open tnabtaf opened this issue 8 years ago • 3 comments

Hi Björn,

I just came across the new cut on test and I have already used the abilities of the new version. However, I can't figure out how to rearrange columns with the new tool. I do this a lot in my basic tutorial, rearranging 8 columns into 6 with

c1,c2,c3,c4,c8,c6

I also can't see if there is a way to duplicate a column. (I haven't needed to do that though.)

Apologies if I'm just missing something here.

Dave C

tnabtaf avatar Jan 20 '16 00:01 tnabtaf

Not Björn, but this uses GNU cut underneath, which does not allow rearrangement or duplication of columns. A more 'honest' representation of 'cut', I suppose. Definitely not as useful as Galaxy's 'cut' tool (a perl script) for many bioinformatics needs though (not that the perl script is perfect).

blankenberg avatar Jan 20 '16 05:01 blankenberg

@tnabtaf first of all thanks for feedback! Dan is correct here, we are using plain unix tools here. Besides the inability for cat to do the rearrangement there is a problem of the new column selector. I discussed this with @guerler already month ago and I forgot what the outcome was. But as it stands the new column selector do not save the ordering and also don't allow to select 1 column twice.

That said we can change this if we want to. @blankenberg we could, replace the column selector by an text field as the original Galaxy tool and we could create a for loop over every every selected column and cut it and paste the results together in a later step.

Another possibility would be to use the column_arrange_by_header tool. We use this tool for file with unpredictable sorting, we could extend it, but would probably end up with a very similar cut tools than the original one. https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/column_arrange_by_header

Nevertheless, there is a lot of duplication between these 3 tools, so any suggestion how I can make it better is welcome. My intention with all this is to use as much as we can GNU-coreutils and don't maintain our own scripts.

bgruening avatar Jan 20 '16 07:01 bgruening

This came up later and had some discussion. Think is worth figuring out what we plan to do. This is really confusing for users (two versions of "Cut" and the core functionality is not the same).

https://github.com/galaxyproject/tools-iuc/issues/2458

jennaj avatar Sep 11 '19 19:09 jennaj