-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconstants.py
191 lines (168 loc) · 4.13 KB
/
constants.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
"""Class holding all project-wide constants."""
import os
__author__ = "Bogdan M. Kirilenko"
__github__ = "https://github.com/kirilenkobm"
class Constants:
LOCATION = os.path.dirname(__file__)
U12_FILE_COLS = 3
U12_AD_FIELD = {"A", "D"}
ISOFORMS_FILE_COLS = 2
NF_DIR_NAME = "nextflow_logs"
NEXTFLOW = "nextflow"
CESAR_PUSH_INTERVAL = 30 # CESAR jobs push interval
ITER_DURATION = 60 # CESAR jobs check interval
MEMLIM_ARG = "--memlim"
FRAGM_ARG = "--fragments"
CESAR_RUNNER = os.path.abspath(os.path.join(LOCATION, "cesar_runner.py"))
CESAR_RUNNER_TMP = "{0} {1} {2} --check_loss {3} --rejected_log {4}"
CESAR_PRECOMPUTED_REGIONS_DIRNAME = "cesar_precomputed_regions"
CESAR_PRECOMPUTED_MEMORY_DIRNAME = "cesar_precomputed_memory"
CESAR_PRECOMPUTED_ORTHO_LOCI_DIRNAME = "cesar_precomputed_orthologous_loci"
CESAR_PRECOMPUTED_MEMORY_DATA = "cesar_precomputed_memory.tsv"
CESAR_PRECOMPUTED_REGIONS_DATA = "cesar_precomputed_regions.tsv"
CESAR_PRECOMPUTED_ORTHO_LOCI_DATA = "cesar_precomputed_orthologous_loci.tsv"
NUM_CESAR_MEM_PRECOMP_JOBS = 500
PARA_STRATEGIES = ["nextflow", "para", "custom"] # TODO: add snakemake
TEMP_CHAIN_CLASS = "temp_chain_trans_class"
MODULES_DIR = "modules"
RUNNING = "RUNNING"
CRASHED = "CRASHED"
TEMP = "temp"
# lists of features required by single and multi exon models
SE_MODEL_FEATURES = ["gl_exo", "flank_cov", "exon_perc", "synt_log"]
ME_MODEL_FEATURES = ["gl_exo", "loc_exo", "flank_cov", "synt_log", "intr_perc"]
# from CESAR_wrapper.py #
FRAGMENT_CHAIN_ID = -1
ORTH_LOC_LINE_SUFFIX = "#ORTHLOC"
UNDEF_REGION = "None:0-0"
# Sequence related #
ATG_CODON = "ATG"
XXX_CODON = "XXX"
GAP_CODON = "---"
NNN_CODON = "NNN"
STOP_CODONS = {"TAG", "TGA", "TAA"}
ACCEPTOR_SITE = ("ag",)
DONOR_SITE = (
"gt",
"gc",
)
class ConstColors:
BLUE = "0,0,200"
LIGHT_BLUE = "0,200,255"
LIGHT_RED = "255,50,50"
SALMON = "255,160,120"
GREY = "130,130,130"
BROWN = "159,129,112"
BLACK = "10,10,10"
class InactMutClassesConst:
MISS_EXON = "Missing exon"
DEL_EXON = "Deleted exon"
DEL_MISS = {MISS_EXON, DEL_EXON}
COMPENSATION = "COMPENSATION"
SSM = "SSM"
# (ag)acceptor-EXON-donor(gt)
SSM_D = "SSMD" # Donor, right, GT,GC
SSM_A = "SSMA" # Acceptor, left, AG
START_MISSING = "START_MISSING"
ATG = "ATG"
FS_DEL = "FS_DEL"
FS_INS = "FS_INS"
BIG_DEL = "BIG_DEL"
BIG_INS = "BIG_INS"
STOP = "STOP"
STOPS = {"TAG", "TAA", "TGA"}
D_M = {"D", "M"}
LEFT_SPLICE_CORR = ("ag",) # acceptor
RIGHT_SPLICE_CORR = (
"gt",
"gc",
) # donor
LEFT_SSID = 0
RIGHT_SSID = 1
ACCEPTOR = 0
DONOR = 1
BIG_INDEL_SIZE = 50
SAFE_EXON_DEL_SIZE = 40 # actually 39
FIRST_LAST_DEL_SIZE = 20
BIG_EXON_THR = BIG_INDEL_SIZE * 5
# Standalone constants #
COMPLEMENT_BASE = {
"A": "T",
"T": "A",
"G": "C",
"C": "G",
"N": "N",
"a": "t",
"t": "a",
"g": "c",
"c": "G",
"n": "n",
}
GENETIC_CODE = {
"TTT": "F",
"TTC": "F",
"TTA": "L",
"TTG": "L",
"TCT": "S",
"TCC": "S",
"TCA": "S",
"TCG": "S",
"TAT": "Y",
"TAC": "Y",
"TAA": "*",
"TAG": "*",
"TGT": "C",
"TGC": "C",
"TGA": "*",
"TGG": "W",
"CTT": "L",
"CTC": "L",
"CTA": "L",
"CTG": "L",
"CCT": "P",
"CCC": "P",
"CCA": "P",
"CCG": "P",
"CAT": "H",
"CAC": "H",
"CAA": "Q",
"CAG": "Q",
"CGT": "R",
"CGC": "R",
"CGA": "R",
"CGG": "R",
"ATT": "I",
"ATC": "I",
"ATA": "I",
"ATG": "M",
"ACT": "T",
"ACC": "T",
"ACA": "T",
"ACG": "T",
"AAT": "N",
"AAC": "N",
"AAA": "K",
"AAG": "K",
"AGT": "S",
"AGC": "S",
"AGA": "R",
"AGG": "R",
"GTT": "V",
"GTC": "V",
"GTA": "V",
"GTG": "V",
"GCT": "A",
"GCC": "A",
"GCA": "A",
"GCG": "A",
"GAT": "D",
"GAC": "D",
"GAA": "E",
"GAG": "E",
"GGT": "G",
"GGC": "G",
"GGA": "G",
"GGG": "G",
"---": "-",
"NNN": "X",
}