Fig. 3: Effects of positive selection on the IBD-based population structure inference.

a Schematic of the one-dimensional stepping-stone model55 with spreading selective sweeps. Five subpopulations (p1 to p5) were split from an ancestral population. There is symmetrical migration between adjacent subpopulations. A favored allele was introduced into the deme from one side of the chain and spread to the other side. b Frequency trajectory of favored alleles (average over chromosomes) in different subpopulations. c Heatmap of pairwise genome-wide total IBD under neutral, selection (s = 0.3, Selection Orig), and selection with IBD peaks removed (Selection Rmpeaks). Rows and columns are ordered by true population labels. d Normalized inter-population IBD sharing between nearby subpopulations. e Modularity of IBD networks with respect to the true population labels before and after removing IBD peaks. f IBD network InfoMap community detection before (left, and middle) and after (right) removing IBD peaks. For each subplot, rows are true subpopulations labeled as p1–p5 (assigned in simulation), and columns represent the largest 5 detected communities labeled as C0–C4 (with columns re-ordered to facilitate the comparison of true and inferred labels). The color of each block represents the number of genomes with the given true labels and detected community labels, with darker colors indicating a larger number of genomes. Source data are provided as a Source data file. For results for different selection coefficients and repeated simulations, see Supplementary Fig. 6 and Supplementary Table 1.