Mercurial > repos > xuebing > sharplabtool
annotate tools/mytools/convertEnsembl.py @ 0:9071e359b9a3
Uploaded
author | xuebing |
---|---|
date | Fri, 09 Mar 2012 19:37:19 -0500 |
parents | |
children |
rev | line source |
---|---|
0 | 1 ''' |
2 convert ensembl bed to ucsc | |
3 add chr to chromosome | |
4 1 = + | |
5 -1 = - | |
6 ''' | |
7 | |
8 import sys | |
9 f = open(sys.argv[1]) | |
10 out = open(sys.argv[2],'w') | |
11 skip = int(sys.argv[3]) | |
12 | |
13 for i in range(skip): | |
14 f.readline() | |
15 | |
16 for line in f: | |
17 flds = line.strip().split('\t') | |
18 flds[0] = 'chr'+flds[0] | |
19 if flds[5] == '1': | |
20 flds[5] = '+' | |
21 else: | |
22 flds[5] = '-' | |
23 out.write('\t'.join(flds)+'\n') | |
24 f.close() | |
25 out.close() | |
26 |