{'fraction_non_alphanumeric': 0.017553793884484713, 'fraction_numerical': 0.0011325028312570782, 'mean_word_length': 5.2, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Studying models of balancing selection using phase-type theory

Balancing selection is an important process, which maintains genetic variability in many functionally important genes. To increase our understanding of its effects on patterns of genetic diversity, we analyse two models of long-term balancing selection at a biallelic locus, one with a constant population size and the other with recent population size changes, as well as a model of recent balancing selection. We use time-inhomogeneous phase-type theory to obtain the expected properties of the gene tree at a neutral site linked to the target of selection, and the linkage disequilibrium (LD) between the selected and neutral sites. For long-term balancing selection, we show that selection targets with equilibrium allele frequencies close to 50% are easier to detect than targets with unequal allele frequencies. The target is also easier to identify after a population size reduction. The spread of a new mutation under balancing selection initially produces diversity patterns in linked neutral regions that are similar to those for a selective sweep caused by positive selection, including reduced diversity and an excess of both high and low frequency derived variants, as well as excess LD with the selected locus. Although the effects of recent balancing selection are more subtle, patterns of diversity and LD remain in a non-equilibrium state for a much longer period than with a sweep, and provide complementary information regarding the selection event. These results can be used for developing new methods for detecting loci under balancing selection, and illustrate the power of time-inhomogeneous phase-type theory, which can be applied to a wide range of population genetic problems.