Mercurial > repos > xuebing > sharplabtool
comparison convertEnsembl.py @ 14:76e1b1b21cce default tip
Deleted selected files
author | xuebing |
---|---|
date | Tue, 13 Mar 2012 19:05:10 -0400 |
parents | 292186c14b08 |
children |
comparison
equal
deleted
inserted
replaced
13:292186c14b08 | 14:76e1b1b21cce |
---|---|
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 |