Replies: 4 comments 3 replies
-
I think you're working with this mental model:
i.e., that "at time t population B got a bunch of ancestry from A". However, msprime is steering you towards this mental model:
i.e., "at time t admixture between A and B created population C". In this picture, both A and B are still around. To do something equivalent to the first picture, you'd have B no longer be around, i.e., make B inactive at the time of admixture:
To do something like the above, you'd want to not have a population
So - your call to |
Beta Was this translation helpful? Give feedback.
-
In my model, populations B,C split 1K generations ago while (B,C) split from A 2K generations ago. So at one generation prior to sampling, all three populations are present. I would like to simulate the first scenario in your schematic, specifically a case where 20% of individuals in generation 1 are migrants from B while the remaining 80% are C residents, at the generation prior to sampling. I tried to do this with:
with C ancestral to the remaining 80% C but I got an error message stating that the admixture event was out of chronological order with respect to the other demography functions (i.e. the splits). Surely there is some way to model the admixture scenario that I'm trying to simulate, i.e. with an established ( (B,C), A) tree established and admixture of C from B in the generation prior to sampling (or indeed any specified generation between 0 and 1K, the time of the B,C split)? You mentioned that to do this, I would need to make (in my example) A inactive. However, at time 0, I want to sample from A,B,C, and I don't want all of C to be derived from B, only 0.2 (and various other values < 1), so I don't think that add_admixture is going to work here, but I'm guessing that something else might? One rather contrived method might be to create a "shell" population D that splits from C in generation 1 from an 80%, 20% C,B admixture, but I'm hoping that there's a more elegant way to do this. Thank you, Max |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks, I used something close to what you suggested (other than using a single label B for the ancestral BC lineage) and it seems to work, insofar as not throwing any errors. However, it's unclear to me how to now sample genotypes from the tree, as there are now 4 lineages "today", "C", "B", "A" rather than the original 3. Since I'm using "today" as a surrogate for C after admixture, I want to sample "today", "B", "A". However, the arrays seem to only consist of 3 populations rather than 4 at the time of sampling: Demographic model:
Running the coalescent and sampling (this was originally in a replication loop for the code, to simplify I set the loop indices to 1): num_replicates = 1
The second print statement gives me a Genotype_Array length of 150 (50 haplotypes x 3) rather than 200 (50 haplotypes x 4). I'm not sure what these 3 populations correspond to - are they "A","B","C" vs. "A","B", "today", or something else? Since "today" was generated from both B and C, I'm not sure which one I need to sample if I want the equivalent of post-admixture C with A,B as outgroups. Similarly, in my seg_sites and nucleotide diversity calculations, what do populations 0,1,2 now correspond to? Are they A,B,C or A,B,"today" (there is no 4th population , i.e. poulation=3 to sample). |
Beta Was this translation helpful? Give feedback.
-
Rather than simulating gene flow in every generation, I would like to model a scenario where there was admixture in a single generation (perhaps in the generation before sampling), with no migration during the rest of the population's history. Is there a straightforward way to do this? Using
would just have gene flow in each generation, so I'm not sure how to simulate admixture in a specific generation using msprime. I did find a function add_admixture, but I'm not sure if the following gives me the desired result of admixture a generation prior to sampling (mrate percent of population p1 having ancestry in p2 in the generation prior to sampling).
I'm also not sure what it means to set the ancestral population as active vs. inactive with this function. If I have a genealogy with 2 splits (generating populations p1, p2, p3) and implement admixture in previous t=1, I'm presumably still able to sample the genotypes in generation 0?
Additionally, I get the following error message in association with add_admixture, even though I use the same names/format of input arguments as for add_population_split (which executes without issues):
The error message that I get for add_admixture is
which (again) doesn't occur when the same population names are used for add_population
Beta Was this translation helpful? Give feedback.
All reactions