# HG changeset patch
# User bgruening
# Date 1445020273 14400
# Node ID f18f67056946d38ce64d13f4e13a3fb03eb4f5dd
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/column_arrange_by_header commit 088e73e958b55dc765778641b8a84080cc289f85-dirty
diff -r 000000000000 -r f18f67056946 columnArrange.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/columnArrange.xml Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,83 @@
+
+ by header name
+
+ pandas
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+**What it does**
+
+With this tool you can specify (by naming the header) which columns need to be leftmost.
+The columns which are not specified will be ordered as before, right of the columns which were specified.
+
+Input file::
+
+ AHeader BHeader CHeader DHeader
+ a b c d
+ a b c d
+
+Specifying **CHeader** and **BHeader**, as the columns that should be leftmost, generates::
+
+ CHeader BHeader AHeader DHeader
+ c b a d
+ c b a d
+
+
+
+
+ @ARTICLE{bgruening_galaxytools,
+ Author = {Björn Grüning, Cameron Smith, Torsten Houwaart, Nicola Soranzo, Eric Rasche},
+ keywords = {bioinformatics, ngs, galaxy, cheminformatics, rna},
+ title = {{Galaxy Tools - A collection of bioinformatics and cheminformatics tools for the Galaxy environment}},
+ url = {https://github.com/bgruening/galaxytools}
+ }
+
+
+
diff -r 000000000000 -r f18f67056946 column_arrange.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/column_arrange.py Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+import pandas as pd
+import argparse
+
+parser = argparse.ArgumentParser()
+parser.add_argument('-i', '--input', help='Tabular Input File Name')
+parser.add_argument('-o','--output', help='Tabular Output File')
+parser.add_argument('-c', '--columns', nargs='+', help='Column Headers to Sort By')
+args=parser.parse_args()
+
+cols = args.columns
+table = pd.read_csv(args.input, sep='\t')
+blist = list(table.columns)
+for token in cols:
+ blist.remove(token)
+sorted_table = table[args.columns + blist]
+# write without index, seperated by tabs
+sorted_table.to_csv(args.output, sep='\t', index=False)
diff -r 000000000000 -r f18f67056946 column_arrange_by_header.tar.gz
Binary file column_arrange_by_header.tar.gz has changed
diff -r 000000000000 -r f18f67056946 test-data/columnarrange_input1.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/columnarrange_input1.tab Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,5 @@
+name fname age nationality
+Woryt Heiko 22 german
+Humte Alfons 49 austrian
+Witz Gerald 12 french
+Koulibaly Ansgard 33 nigerian
diff -r 000000000000 -r f18f67056946 test-data/columnarrange_input2.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/columnarrange_input2.tab Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,5 @@
+second name age nationality first name
+Woryt 22 german Heiko
+Humte 49 austrian Alfons
+Witz 12 french Gerald
+Koulibaly 33 nigerian Ansgard
diff -r 000000000000 -r f18f67056946 test-data/columnarrange_result1.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/columnarrange_result1.tab Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,5 @@
+fname age name nationality
+Heiko 22 Woryt german
+Alfons 49 Humte austrian
+Gerald 12 Witz french
+Ansgard 33 Koulibaly nigerian
diff -r 000000000000 -r f18f67056946 test-data/columnarrange_result2.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/columnarrange_result2.tab Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,5 @@
+first name nationality second name age
+Heiko german Woryt 22
+Alfons austrian Humte 49
+Gerald french Witz 12
+Ansgard nigerian Koulibaly 33
diff -r 000000000000 -r f18f67056946 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Fri Oct 16 14:31:13 2015 -0400
@@ -0,0 +1,6 @@
+
+
+
+
+
+