# HG changeset patch # User devteam # Date 1470429493 14400 # Node ID cec635fab700b3805460689d39105b59d81f1fc4 # Parent 842fab69c9400b2773761126e3670f4718a56b8f planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cut_columns commit e3d5231ad1ca93ad49117e9804266f371d863e82 diff -r 842fab69c940 -r cec635fab700 cutWrapper.pl --- a/cutWrapper.pl Wed Nov 11 12:10:10 2015 -0500 +++ b/cutWrapper.pl Fri Aug 05 16:38:13 2016 -0400 @@ -9,6 +9,9 @@ my @out = (); my $command = ""; my $field = 0; +my $start = 0; +my $end = 0; +my $i = 0; # a wrapper for cut for use in galaxy # cutWrapper.pl [filename] [columns] [delim] [output] @@ -20,6 +23,13 @@ if (m/^c\d{1,}$/i) { push (@columns, $_); $columns[@columns-1] =~s/c//ig; + } elsif (m/^c\d{1,}-c\d{1,}$/i) { + ($start, $end) = split(/-/, $_); + $start =~ s/c//ig; + $end =~ s/c//ig; + for $i ($start .. $end) { + push (@columns, $i); + } } } diff -r 842fab69c940 -r cec635fab700 cutWrapper.xml --- a/cutWrapper.xml Wed Nov 11 12:10:10 2015 -0500 +++ b/cutWrapper.xml Fri Aug 05 16:38:13 2016 -0400 @@ -1,202 +1,219 @@ - - columns from a table - cutWrapper.pl "${input}" "${columnList}" "${delimiter}" "${out_file1}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -**WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on the pencil icon in the latest history item. - -.. class:: infomark - -The output of this tool is always in tabular format (e.g., if your original delimiters are commas, they will be replaced with tabs). For example: - - Cutting columns 1 and 3 from:: - - apple,is,good - windows,is,bad - - will give:: - - apple good - windows bad - ------ - -**What it does** - -This tool selects (cuts out) specified columns from the dataset. - -- Columns are specified as **c1**, **c2**, and so on. Column count begins with **1** -- Columns can be specified in any order (e.g., **c2,c1,c6**) -- If you specify more columns than actually present - empty spaces will be filled with dots - ------ - -**Example** - -Input dataset (six columns: c1, c2, c3, c4, c5, and c6):: - - chr1 10 1000 gene1 0 + - chr2 100 1500 gene2 0 + - -**cut** on columns "**c1,c4,c6**" will return:: - - chr1 gene1 + - chr2 gene2 + - -**cut** on columns "**c6,c5,c4,c1**" will return:: - - + 0 gene1 chr1 - + 0 gene2 chr2 - - -**cut** on columns "**c8,c7,c4**" will return:: - - . . gene1 - . . gene2 - - - - + + columns from a table + + perl $__tool_directory__/cutWrapper.pl + "${input}" + "${columnList}" + "${delimiter}" + "${out_file1}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +**WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on the pencil icon in the latest history item. + +.. class:: infomark + +The output of this tool is always in tabular format (e.g., if your original delimiters are commas, they will be replaced with tabs). For example: + + Cutting columns 1 and 3 from:: + + apple,is,good + windows,is,bad + linux,is,best + + will give:: + + apple good + windows bad + linux best + +----- + +**What it does** + +This tool selects (cuts out) specified columns from the dataset. + +- Columns are specified as **c1**, **c2**, and so on. Column count begins with **1** +- Columns can be specified in any order (e.g., **c2,c1,c6**) +- If you specify more columns than actually present - empty spaces will be filled with dots + +----- + +**Example** + +Input dataset (six columns: c1, c2, c3, c4, c5, and c6):: + + chr1 10 1000 gene1 0 + + chr2 100 1500 gene2 0 + + +**cut** on columns "**c1,c4,c6**" will return:: + + chr1 gene1 + + chr2 gene2 + + +**cut** on columns "**c6,c5,c4,c1**" will return:: + + + 0 gene1 chr1 + + 0 gene2 chr2 + +**cut** on columns "**c1-c3**" will return:: + + chr1 10 1000 + chr2 100 1500 + + +**cut** on columns "**c8,c7,c4**" will return:: + + . . gene1 + . . gene2 + +