Mercurial > repos > fubar > tool_factory_2
annotate test-data/runme.py @ 26:db35d39e1de9 draft
Passes planemo test
Uses galaxyxml to generate new tool.
More outputs will be added...
author | fubar |
---|---|
date | Thu, 30 Jul 2020 06:48:45 -0400 |
parents | |
children |
rev | line source |
---|---|
26 | 1 # reverse order of columns in a tabular file |
2 import argparse | |
3 parser = argparse.ArgumentParser() | |
4 a = parser.add_argument | |
5 a('--infile',default='') | |
6 a('--outfile',default=None) | |
7 a('--prefix',default=None) | |
8 args = parser.parse_args() | |
9 inp = args.infile | |
10 outp = args.outfile | |
11 i = open(inp,'r').readlines() | |
12 o = open(outp,'w') | |
13 for row in i: | |
14 rs = row.rstrip() | |
15 rs = list(rs) | |
16 rs.reverse() | |
17 o.write('%s:%s' % (args.prefix,''.join(rs))) | |
18 o.write('\n') | |
19 o.close() |