Constant number of mutation instead of rate #2049
-
Hi all, My attempt is to use sim_ancestry with sequence_length=N, recombination_rate=0.5 Later I want to simulate a single SNP (a binary mutation) for each point on the sequence, with union distribution on the corresponding tree "branches". So I do something like this:
But, I am not sure what rate should I specify. The doc says "The rate of mutation per unit of sequence length per unit time, as either a single number (for a uniform rate) or as a RateMap" Btw, what if I have more than 1 mutation in the same nucleotide? Can it create reverse mutations? I don't want my simulation to have more than 1 mutation, or reverse mutation in the same nucleotide. Wonderful lib guys, well done. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey @shaharMazia 👋 If you're assuming unlinked loci (i.e with free recombination) then you're almost certainly better off just simulating those loci separately without recombination. This will be much faster. Simulating a fixed number of mutations is very subtle, and we don't recommend doing it usually. See #1806 and #68 for previous discussions. Why do you need exactly one mutation per site? If you want to be certain of no recurrent mutations, you can specify "infinite sites" using the |
Beta Was this translation helpful? Give feedback.
Hey @shaharMazia 👋
If you're assuming unlinked loci (i.e with free recombination) then you're almost certainly better off just simulating those loci separately without recombination. This will be much faster.
Simulating a fixed number of mutations is very subtle, and we don't recommend doing it usually. See #1806 and #68 for previous discussions. Why do you need exactly one mutation per site?
If you want to be certain of no recurrent mutations, you can specify "infinite sites" using the
discrete_genome=False
option -- see here for discussion.