-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDP_gene_FSR.py
63 lines (56 loc) · 2.3 KB
/
SDP_gene_FSR.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
from collections import OrderedDict
import MoNeT_MGDrivE as monet
###############################################################################
# https://github.com/Chipdelmal/MGDrivE/blob/master/MGDrivE/R/Cube-RIDL.R
###############################################################################
genotypes = ('WW', 'WR', 'RR')
locus = (0, 1)
###############################################################################
# Ecology genotype counts
###############################################################################
ECO_DICT = OrderedDict((
('W', (('W', locus), )),
('R', (('R', locus), ))
))
FSR_ECO = monet.geneFrequencies(ECO_DICT, genotypes)
###############################################################################
# Health genotype counts
###############################################################################
HLT_DICT = OrderedDict((
('H*', (('R', locus), )),
('O-', (('W', locus), ))
))
FSR_HLT = monet.carrierFrequencies(HLT_DICT, genotypes)
###############################################################################
# Trash genotype counts
###############################################################################
TRS_DICT = OrderedDict((
('R*', (('R', locus), )),
('O-', (('W', locus), ))
))
FSR_TRS = monet.carrierFrequencies(TRS_DICT, genotypes)
###############################################################################
# Wild genotype counts
###############################################################################
WLD_DICT = OrderedDict((
('O*', (('R', locus), )),
('W-', (('W', locus), ))
))
FSR_WLD = monet.carrierFrequencies(WLD_DICT, genotypes, invert=False)
###############################################################################
# Drive Selector
###############################################################################
def driveParameters(TYPE, popSize):
if TYPE == 'ECO':
aggD = monet.generateAggregationDictionary(*FSR_ECO)
yRange = popSize
elif TYPE == 'HLT':
aggD = monet.generateAggregationDictionary(*FSR_HLT)
yRange = popSize/4
elif TYPE == 'TRS':
aggD = monet.generateAggregationDictionary(*FSR_TRS)
yRange = popSize
elif TYPE == 'WLD':
aggD = monet.generateAggregationDictionary(*FSR_WLD)
yRange = popSize
return (aggD, yRange, 'fsRIDL')