-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrc
More file actions
executable file
·53 lines (48 loc) · 742 Bytes
/
rc
File metadata and controls
executable file
·53 lines (48 loc) · 742 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("seq")
parser.add_argument("--rna", action="store_true")
args = parser.parse_args()
char_dict = {
'A': 'T',
'C': 'G',
'G': 'C',
'T': 'A',
'R': 'Y',
'Y': 'R',
'S': 'W',
'W': 'S',
'K': 'M',
'M': 'K',
'B': 'V',
'V': 'B',
'D': 'H',
'H': 'D',
'N': 'N',
'a': 't',
'c': 'g',
'g': 'c',
't': 'a',
'r': 'y',
'y': 'r',
's': 'w',
'w': 's',
'k': 'm',
'm': 'k',
'b': 'v',
'v': 'b',
'd': 'h',
'h': 'd',
'n': 'n',
'.': '.',
'-': '-'
}
if args.rna:
char_dict['A'] = 'U'
char_dict['U'] = 'A'
del char_dict['T']
char_dict['a'] = 'u'
char_dict['u'] = 'a'
del char_dict['t']
print("".join([char_dict[x] for x in args.seq][::-1]))