To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 62411290 authored by Eva Bons's avatar Eva Bons

added a lognormal_ben_only model for the MFED

parent 6880fa07
from . import simulation
from . import GUI
from . import Scenarios
from . import binary_fission
#from . import GUI
#from . import Scenarios
#from . import binary_fission
......@@ -169,7 +169,8 @@ class Simulation(object):
Keyword Arguments:
model (str): model to use for the MFED (otions: 'neutral'(default),
'lognormal','exponential','spikes','beta', 'from_data','steps')
'lognormal','exponential','spikes','beta', 'from_data','steps',
'lognormal_ben_only')
parameters (dict): parameters for the MFED
mut_rate (float): mutation rate per site per generation (default = 2.16e-5)
subs_matrix (4x4 list): cumulative substitution matrix
......@@ -304,12 +305,14 @@ class Simulation(object):
if randnr < prob:
fitness[i, j] = self.settings['parameters']['loc'][spike]
break
elif self.settings['model'] == 'lognormal':
elif self.settings['model'] in ['lognormal','lognormal_ben_only']:
for i, j in zip(to_fill[0], to_fill[1]):
randnr = random.random()
if randnr > self.settings['parameters']['fl']:
fitness[i, j] = np.random.lognormal(self.settings['parameters']['mu'],
self.settings['parameters']['sigma'])
if self.settings['model'] == 'lognormal_ben_only':
fitness[fitness < 1] = 1
elif self.settings['model'] == 'beta':
randnr = random.random()
if randnr > self.settings['parameters']['fl']:
......
......@@ -26,10 +26,10 @@ setup(
author='Eva Bons',
author_email='eva.bons@gmail.com',
packages=find_packages(exclude=['contrib', 'docs', 'Tests']),
packages=find_packages('.',exclude=['contrib', 'docs', 'Tests']),
python_requires='>=2.7',
install_requires=['matplotlib==2.2','appJar','pyyaml','numpy==1.15.1','tqdm','scipy==1.1'],
install_requires=['matplotlib','appJar','pyyaml','numpy','tqdm','scipy'],
package_data={
'SeqSimEvo': ['simulation_settings/*','Scenarios/settings_files/*']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment