In [1]:
import os
from Bio.PopGen import SimCoal as simcoal
from Bio.PopGen.SimCoal.Template import generate_simcoal_from_template
from Bio.PopGen.SimCoal.Controller import FastSimCoalController as fsc
In [2]:
print(simcoal.builtin_tpl_dir)
print(os.listdir(simcoal.builtin_tpl_dir))
In [3]:
f = open(simcoal.builtin_tpl_dir + os.sep + 'simple.par')
print(f.readlines())
In [4]:
n_indep_MSATs = [(200, [('MICROSAT', [1, 0, 0.005, 0, 0])])] # refer fastsimcoal documentation
linked_snps = [(1, [('SNP', [200, 0.0005, 0.01])])]
linked_DNA = [(1, [('DNA', [1000, 0.0005, 0.0000002, 0.33])])]
complex_genome = [(2, [
('DNA', [10, 0.00001, 0.00005, 0.33]),
('SNP', [1, 0.001, 0.0001]),
('MICROSAT', [1, 0.0, 0.001, 0.0, 0.0])])]
In [5]:
simple = [('sample_size', [30]),
('pop_size', [100, 200])]
island = [('sample_size', [30]),
('pop_size', [100]),
('mig', [0.01]),
('total_demes', [10])]
split_ssm_1d = [('sample_size', [30]),
('pop_size', [100]),
('mig', [0.01]),
('ne', [500]),
('t', [100]),
('total_demes', [10])]
In [6]:
generate_simcoal_from_template('island', complex_genome, island)
generate_simcoal_from_template('simple', n_indep_MSATs, simple)
generate_simcoal_from_template('split_ssm_1d', linked_snps, split_ssm_1d)
#careful with overidding parameter files
In [8]:
ctrl = fsc(bin_name='fsc252')
In [10]:
ctrl.run_fastsimcoal('simple_100_30.par', 10)
ctrl.run_fastsimcoal('simple_200_30.par', 10)
ctrl.run_fastsimcoal('island_10_0.01_100_30.par', 10)
ctrl.run_fastsimcoal('split_ssm_1d_10_100_500_0.01_100_30.par', 10)
In [ ]: