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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
1 # reverse order of columns in a tabular file
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
2 import argparse
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
3 parser = argparse.ArgumentParser()
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
4 a = parser.add_argument
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
5 a('--infile',default='')
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
6 a('--outfile',default=None)
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
7 a('--prefix',default=None)
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
8 args = parser.parse_args()
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
9 inp = args.infile
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
10 outp = args.outfile
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
11 i = open(inp,'r').readlines()
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
12 o = open(outp,'w')
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
13 for row in i:
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
14 rs = row.rstrip()
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
15 rs = list(rs)
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
16 rs.reverse()
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
17 o.write('%s:%s' % (args.prefix,''.join(rs)))
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
18 o.write('\n')
db35d39e1de9 Passes planemo test
fubar
parents:
diff changeset
19 o.close()