Re: [dadi-user] Defining complex demography

24 views
Skip to first unread message

Ryan Gutenkunst

unread,
Mar 5, 2024, 3:04:16 PMMar 5
to dadi-user
Hello Miles,

The integration methods really define time intervals. So the integration will move the populations forward T-initial_t time units. So your integration intervals below are Tsplit, TB, TF. That’s probably what you want. (The initial_t argument is most useful when you have temporally varying parameters during an interval.)

Best,
Ryan

> On Mar 5, 2024, at 3:04 AM, Miles Anderson <milesan...@gmail.com> wrote:
>
> Hi, Ryan
>
> Sorry for the influx of questions recently, but I was wondering if I've understood and defined a custom model correctly.
>
> We want a population split followed by both populations entering a bottleneck at the same time, followed by both populations exiting the bottleneck at the same time. My question is about the integration times.
> def split_bottleneck(params,ns,pts):
> """
> nu1: size of population 1 after split
> nu2: size of population 2 after split
> Tsplit: time of population split
> TB: time of bottleneck in population
> nu1B: size of population 1 during bottleneck
> nu2B: size of population 2 during bottleneck
> TF: time of bottleneck recovery in population
> nu1F: size of population 1 after recovery
> nu2F: size of population 2 after recovery
> """
> nu1, nu2, Tsplit, TB, nu1B, nu2B, TF, nu1F, nu2F=params
> xx = dadi.Numerics.default_grid(pts)
>
> phi = dadi.PhiManip.phi_1D(xx)
> phi = dadi.PhiManip.phi_1D_to_2D(xx, phi)
>
> phi = dadi.Integration.two_pops(phi, xx, T=Tsplit, nu1=nu1, nu2=nu2) # sizes after split
> phi = dadi.Integration.two_pops(phi, xx, T=Tsplit+TB, nu1=nu1B, nu2=nu2B, initial_t=Tsplit) # simultaneous bottleneck
> phi = dadi.Integration.two_pops(phi, xx, T=TB+TF, nu1=nu1F, nu2=nu2F, initial_t=TB) # sizes after split
>
> fs = dadi.Spectrum.from_phi(phi, ns, (xx,xx))
> return fs
>
>
> So would this define the scenario correctly? Integration starts at the end of the time interval preceding it and ends at the combined interval of the step before and the current step? Or should the last integration be T=Tsplit+TB+TF? Or is it entirely incorrect?
>
> Thank you,
> Miles
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "dadi-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dadi-user+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dadi-user/298468f1-8a77-41e8-b103-a1a449f40576n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages