Hi, Ryan,
Sorry for my delay due to something. You are right, the script I used above is right, since I have seen the similar result from some published papers. These weeks I have carefully read the manual and examples again, and try to apply some probable models to my data set. Again, I get some questions that confused.
1: How to get the best topology among three populations by dadi. For example I got three population and there are four possible topology, (pop1(pop2,pop3)), (pop2(pop1,pop3)), (pop3(pop1,pop2)),and the last one is ancestral population split into three populations simultaneously. I can't get the answer from the manual and examples to solve this situation maybe I misread something.
2: Another question is I want to setup a new model to my data, which the initial population go through a split, then the children populations begin grow exponential respectively and then, they both suffered a bottleneck, then, one of the children population ( ancestral pop2) stated to split pop2 and pop3 due to some refugee barrier. So I try to imitate the examples to write the scripts. But I don't know how to add the bottleneck event after a simultaneously exponential event. Here is the script that I try to write down:
import numpy
from dadi import Numerics, PhiManip, Integration, Spectrum
def newmodel (...) (bypass)
xx = Numerics.default_grid(pts)
phi = PhiManip.phi_1D(xx)
phi = PhiManip.phi_1D (xx, phi, nu = nuA) # nuA: ancestral population size,
# ancestral population initial split.T1: the first split, T2: the time of the total population size peak that go throng a exponential growth. nuQ2 and nuQ1 mean one of children population #size experience a exponential growth from nuQ1 to nuQ2. nuN2 and nuN1 represent another children population experience the same event.
phi = PhiManip.phi_1D_to_2D(xx, phi)
nuQ2_func = lambda t: nuQ2 * (nuQ1/nuQ2)**(t/(T1-T2)
nuN2_func = lambda t: nuN2 * (nuN1/nuN2)**(t/(T1-T2)
# then both of the children populations experience a bottleneck ( the following is right? Imitate from one of topic in this group, seemly same to exponential event )
nuQ3_func = nuQ3*(nuQ2/nuQ3)**(t/T2-T3) #T3: mean the time of end of bottleneck. nuQ3 and nuN3 mean the two children population size after experience a bottleneck event.
nuN3_func = nuN3*(nuN2/nuN3)**(t/T2-T3)
phi = Integration.two_pops(phi, xx, T1, T2, T3, nuQ2_func, nuN2_func, nuQ3_fun, nuN3_func,
then how to write the migration over time T1-T2 and T2-T3 between the two children populations)
# then one of children population split (bypass)
Sorry about the bad python programming, I'm really not good at python. It's very appreciate that you give me some suggestions.
Baolin