-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDP_gene_CRS.py
76 lines (68 loc) · 2.99 KB
/
SDP_gene_CRS.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
from collections import OrderedDict
import MoNeT_MGDrivE as monet
###############################################################################
# https://github.com/Chipdelmal/MGDrivE/blob/master/MGDrivE/R/Cube-ASmidler.R
###############################################################################
genotypes = (
'WWWW','PWWW','MWWW','WGWW','PGWW','MGWW','WRWW','PRWW','MRWW','WBWW','PBWW',
'MBWW','MWPW','PWWG','MGPW','PWWR','MRPW','PWWB','MBPW','MWWG','MWPG','MWWR',
'MWPR','MWWB','MWPB','WGWG','PGWG','MGWG','WGWR','PRWG','MRWG','WBWG','PBWG',
'MBWG','MGPG','PGWR','MRPG','PGWB','MBPG','MGWR','MGPR','MGWB','MGPB','WRWR',
'PRWR','MRWR','WBWR','PBWR','MBWR','MRPR','PRWB','MBPR','MRWB','MRPB','WBWB',
'PBWB','MBWB','MBPB'
)
(locusA, locusB, locusF) = ((0, 2), (1, 3), (0, 1, 2, 3))
###############################################################################
# Ecology genotype counts
###############################################################################
ECO_DICT = OrderedDict((
('WA', (('W', locusA), )),
('P', (('P', locusA), )),
('M', (('M', locusA), )),
('WB', (('W', locusB), )),
('G', (('G', locusB), )),
('B', (('B', locusB), )),
('R', (('R', locusB), ))
))
CRS_ECO = monet.geneFrequencies(ECO_DICT, genotypes)
###############################################################################
# Health genotype counts
###############################################################################
HLT_DICT = OrderedDict((
('H*', (('G', locusB), )),
('O-', (('W', locusB), ('B', locusB), ('R', locusB)))
))
CRS_HLT = monet.carrierFrequencies(HLT_DICT, genotypes)
###############################################################################
# Trash genotype counts
###############################################################################
TRS_DICT = OrderedDict((
('C*', (('P', locusA), ('M', locusA))),
('O-', (('W', locusA), ))
))
CRS_TRS = monet.carrierFrequencies(TRS_DICT, genotypes)
###############################################################################
# Wild genotype counts
###############################################################################
WLD_DICT = OrderedDict((
('O*', (('B', locusB), ('R', locusB), ('G', locusB))),
('W-', (('W', locusB), ))
))
CRS_WLD = monet.carrierFrequencies(WLD_DICT, genotypes)
###############################################################################
# Drive Selector
###############################################################################
def driveParameters(TYPE, popSize):
if TYPE == 'ECO':
aggD = monet.generateAggregationDictionary(*CRS_ECO)
yRange = popSize*2
elif TYPE == 'HLT':
aggD = monet.generateAggregationDictionary(*CRS_HLT)
yRange = popSize/4
elif TYPE == 'TRS':
aggD = monet.generateAggregationDictionary(*CRS_TRS)
yRange = popSize
elif TYPE == 'WLD':
aggD = monet.generateAggregationDictionary(*CRS_WLD)
yRange = popSize
return (aggD, yRange, 'CRISPR-Classic')