Genetic map in stdpopsim is read by using read_hapmap function in msprime (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/genetic_maps.py#L105), and is loaded to SLiM by using msprime_rm_to_slim_rm function, (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L884). The genetic map loaded by msprime has NaN at the beginning to account for telomere regions, but it is converted into a recombination rate of 0 in SLiM, (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L908).
This long non-recombining region at the beginning gets removed in the final output from recapitation and simplifacation in msprime simulation, but it causes some issues when there is selection implemented in SLiM. Specifically, if users follow "Simulating with a genome-wide DFE" in stdpopsim manual (https://popsim-consortium.github.io/stdpopsim-docs/stable/tutorial.html#simulating-with-a-genome-wide-dfe), initializeGenomicElement will start from 0 (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L1327), and there is a long 0 recombination rate region at the beginning of the SLiM tree sequence output with a bunch of mutations. This will influence the final tree sequence output, even though there should not be any selected mutations in the telomere region.
Suggested fixes:
Instead of simply setting a recombination rate of 0 for NaN regions, we might be able to store the region in an array and remove that region from the DFE region.
Genetic map in stdpopsim is read by using
read_hapmapfunction in msprime (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/genetic_maps.py#L105), and is loaded to SLiM by usingmsprime_rm_to_slim_rmfunction, (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L884). The genetic map loaded by msprime hasNaNat the beginning to account for telomere regions, but it is converted into a recombination rate of0in SLiM, (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L908).This long non-recombining region at the beginning gets removed in the final output from recapitation and simplifacation in msprime simulation, but it causes some issues when there is selection implemented in SLiM. Specifically, if users follow "Simulating with a genome-wide DFE" in stdpopsim manual (https://popsim-consortium.github.io/stdpopsim-docs/stable/tutorial.html#simulating-with-a-genome-wide-dfe),
initializeGenomicElementwill start from 0 (https://github.com/popsim-consortium/stdpopsim/blob/main/stdpopsim/slim_engine.py#L1327), and there is a long 0 recombination rate region at the beginning of the SLiM tree sequence output with a bunch of mutations. This will influence the final tree sequence output, even though there should not be any selected mutations in the telomere region.Suggested fixes:
Instead of simply setting a recombination rate of 0 for NaN regions, we might be able to store the region in an array and remove that region from the DFE region.