comparison reactivity_cal/separate_rna.py @ 5:7a8ddf1819b1 draft

Uploaded
author tyty
date Mon, 15 Sep 2014 14:52:52 -0400
parents
children
comparison
equal deleted inserted replaced
4:a292aaf51735 5:7a8ddf1819b1
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import sys
5 from parse_dis_pac import *
6
7
8 dist_file = sys.argv[1]
9 cdna_file = sys.argv[2]
10 rrna_file = sys.argv[3]
11
12 dist = parse_dist(dist_file)
13 dist = dist[1]
14 hc = file(cdna_file, 'w')
15 hr = file(rrna_file, 'w')
16
17 for t in dist:
18 if t.find('AT') != -1:
19 hc.write(t)
20 hc.write('\n')
21 for i in range(len(dist[t])-1):
22 hc.write(dist[t][i])
23 hc.write('\t')
24 i = i+1
25 hc.write(dist[t][i])
26 hc.write('\n')
27 else:
28 hr.write(t)
29 hr.write('\n')
30 for i in range(len(dist[t])-1):
31 hr.write(dist[t][i])
32 hr.write('\t')
33 i = i+1
34 hr.write(dist[t][i])
35 hr.write('\n')
36
37 hc.close()
38 hr.close()
39
40
41
42