annotate unfold_column.py @ 9:d9819ccb9ca7
draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 369e40078146d00608d52205bb8cee66ae735b76-dirty
author |
bgruening |
date |
Tue, 30 Jun 2015 17:47:36 -0400 |
parents |
56e80527c482 |
children |
c78b1767db2b |
rev |
line source |
4
|
1 #!/usr/bin/env python
|
|
2
|
|
3 import sys
|
|
4
|
|
5 out = open(sys.argv[4], 'w+')
|
|
6
|
|
7 with open(sys.argv[1]) as handle:
|
|
8 for line in handle:
|
|
9 cols = line.split('\t')
|
|
10 unfolding_column = int(sys.argv[2]) - 1
|
|
11 column_content = cols[ unfolding_column ]
|
|
12 for elem in column_content.split( sys.argv[3] ):
|
|
13 out.write( '\t'.join( cols[:unfolding_column] + [elem] + cols[unfolding_column+1:]) )
|
|
14 out.close()
|