0
|
1 #!/usr/bin/env python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 import sys
|
|
5 from read_file import *
|
|
6 from Bio import SeqIO
|
|
7
|
|
8 unmap_file = sys.argv[1]
|
|
9 reads_file = sys.argv[2]
|
|
10 result_file = sys.argv[3]
|
|
11 tp = sys.argv[4]
|
|
12
|
|
13
|
|
14 unmap = read_t_file(unmap_file);
|
|
15
|
|
16 h = file(result_file, 'w')
|
|
17
|
|
18 reads = SeqIO.parse(reads_file,tp)
|
|
19 um = set()
|
|
20 for i in range(0, len(unmap)):
|
|
21 id_r = unmap[i][0]
|
|
22 um.add(id_r)
|
|
23
|
|
24 for read in reads:
|
|
25 if read.id in um:
|
|
26 h.write('>')
|
|
27 h.write(read.id)
|
|
28 h.write('\n')
|
|
29 h.write(read.seq.tostring())
|
|
30 h.write('\n')
|
|
31
|
|
32
|
|
33
|
|
34 h.close()
|
|
35
|
|
36
|
|
37
|
|
38
|