-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixIDAfterMafft.py
31 lines (24 loc) · 985 Bytes
/
fixIDAfterMafft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
from collections import defaultdict as d
from optparse import OptionParser, OptionGroup
# Author: Martin Kapun
######################################################### HELP #########################################################################
usage = "python %prog --input file --output file "
parser = OptionParser(usage=usage)
group = OptionGroup(parser, "< put description here >")
######################################################### CODE #########################################################################
parser.add_option("--input", dest="IN", help="Input file")
parser.add_option("--Alignment", dest="Al", help="Output file")
(options, args) = parser.parse_args()
parser.add_option_group(group)
Rep = []
for l in open(options.IN, "rt"):
if l.startswith(">"):
Rep.append(l.rstrip())
C = 0
for l in open(options.Al, "rt"):
if l.startswith(">"):
print(Rep[C])
C += 1
continue
print(l.rstrip())