-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathblastn.py
More file actions
55 lines (50 loc) · 1.29 KB
/
Copy pathblastn.py
File metadata and controls
55 lines (50 loc) · 1.29 KB
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
54
55
CRED = '\033[91m'
CEND = '\033[0m'
import utils
import numpy as np
import save
def generate(X, seqType, args):
'''
# Reference: https://www.cs.cmu.edu/~02710/Lectures/ScoringMatrices2015.pdf
:param X:
:param seqType:
:param args:
:return:
'''
if seqType == 'DNA':
d = {
'A': [ 5, -4, -4, -4],
'C': [-4, -4, 5, -4],
'G': [-4, -4, -4, 5],
'T': [-4, 5, -4, -4],
'p': [ 0, 0, 0, 0], # padding
}
else:
if seqType == 'RNA':
d = {
'A': [ 5, -4, -4, -4],
'C': [-4, -4, 5, -4],
'G': [-4, -4, -4, 5],
'U': [-4, 5, -4, -4],
'p': [ 0, 0, 0, 0], # padding
}
else:
if seqType == 'PROT':
print(CRED + 'Error: The \'BLASTn\' feature is NOT applicable for PROT.' + CEND)
return None
else:
return None
#end-if
# print(X)
X = utils.processMono(X, d, args)
totalFeature = 0
if seqType == 'DNA' or seqType == 'RNA':
totalFeature = 4
else:
if seqType == 'PROT':
None
else:
None
# end-if
save.datasetSave(X, totalFeature, 'blastn')
#end-def