Abstract
Linkage disequilibrium methods for demographic inference usually rely on panmictic population models. However, the structure of natural populations is generally complex and the quality of the genotyping data is often suboptimal. We present two software tools that implement theoretical developments to estimate the effective population size (Ne): GONE2, for inferring recent changes in Ne when a genetic map is available, and currentNe2, which estimates contemporary Ne even in the absence of genetic maps. These tools operate on SNP data from a single sample of individuals, and provide insights into population structure, including the FST index, migration rate, and subpopulation number. GONE2 can also handle haploid data, genotyping errors, and low sequencing depth data. Results from simulations and laboratory populations of Drosophila melanogaster validated the tools in different demographic scenarios, and analysis were extended to populations of several species. These results highlight that ignoring population subdivision often leads to Ne underestimation.
Subject terms: Population genetics, Genetic variation, Conservation genomics
Accurate estimation of effective population size is critical for understanding population history but is often confounded by structure and data quality. Here, the authors show that GONE2 and currentNe2 infer this from SNP data while accounting for structure and suboptimal genotyping.
Introduction
The concept of effective population size (Ne)1 is fundamental to population genetics, quantifying the extent of genetic drift, inbreeding, and adaptive potential. Understanding recent variation in Ne is relevant for assessing conservation status and guiding management strategies2,3. Traditional methods for estimating Ne4–7 provide limited resolution of recent demographic change. Coalescent methods, which typically rely on mutation rates to determine the time of occurrence of demographic events in the past, are more appropriate for estimating Ne in ancient times than for recent demography8,9. Methods based on the distribution of identity-by-descent (IBD) lengths across the genome10–13 require high-quality phased genotypes and dense marker sets, limiting their utility in non-model systems.
Linkage disequilibrium (LD)-based methods have emerged as powerful tools for inferring demographic history from single-sample genomic data, even with moderate data quality14. These methods can be traced back to the seminal work by Hill and Robertson15, who established the relationship between recombination rates and disequilibrium decay in finite populations. As this decay varies significantly with recombination rates, comparing observed LD between loci at different distances provides insights into population dynamics in the recent past10,16–18. An advantage of LD methods is the possibility to infer Ne from a small number of unphased genotypes, even in the absence of a genetic map19, provided that the total genetic size of the genome is known. This makes LD methods particularly valuable for the study of non-model species where comprehensive genetic resources may be lacking. Several software tools have been developed to use LD data for demographic inference, including NeEstimator20, GONE18, currentNe21, and HapNe-LD13.
A persistent limitation of existing LD tools is their reliance on panmictic population models, which can introduce substantial biases in Ne estimates when applied to structured populations22–25. This shortcoming has critical implications for conservation genetics, where the magnitude of Ne is used as an indicator of long-term population persistence26, and understanding genetic connectivity between subpopulations is critical for developing effective conservation strategies. The work of Ragsdale and Gravel27 approached this problem by using transition matrices of two locus moments but, while theoretically comprehensive, the method is computationally intractable when applied to genome-scale datasets of randomly sampled individuals.
To address this challenge, we present theoretical developments implemented in the latest releases of GONE2 and currentNe2, that allow the effective size, the genetic differentiation index FST, the migration rate, and the number of subpopulations to be inferred from a single sample of individuals taken at random from a population. The method combines the information on the LD of pairs of sites in different chromosomes, the LD between weakly linked sites, and the average inbreeding coefficient. This approach provides deeper insight into the recent demography in geographically structured populations. In addition, GONE2 includes new features such as the analysis of haploid data, and the handling of genotyping error rates and low sequencing depth, which are typical problems encountered particularly when analyzing ancient DNA28. Both software releases are also more compact and significantly faster than the previous versions, making them easier to use in a single command-line format and enabling the analysis of larger samples.
Results
Accounting for population structure
Linkage disequilibrium (δ2) is defined by the ratio of expectations of the squared covariances (D2) and the products of variances (W) of pairs of loci29. An island model30 of s equal-sized subpopulations and reciprocal migration rate m is assumed across the theoretical developments. For this model, the LD can be partitioned into the within-subpopulations component , the between-subpopulations component and the between-within component (see Section 2 of the Supplementary Information):
| 1 |
In a metapopulation at migration-drift equilibrium, the expectations of the terms in the equation becomes:
where c is the recombination rate between loci, and FST is Wright’s30 differentiation index. This formulation scales panmictic LD expectations by , where NT represents the summed effective sizes of all subpopulations. In the context of metapopulations, this concept differs from the effective metapopulation size Ne, which refers to the effective population size of drift for the entire metapopulation31. At migration-drift equilibrium, these two concepts are linked by the equation 32. The between deme component follows:
where s is the number of subpopulations. The between-within component approximates:
(see Section 2.2 of the Supplementary Information for a more accurate equation for closely linked sites).
Empirical validation with simulations of metapopulations with two and four subpopulations (Supplementary Tables 1 and 2) confirms this partitioning across recombination regimes, population sizes and migration rates. Supplementary Fig. 1 illustrates the theoretical LD partitioning over a range of recombination rates in a metapopulation with two subpopulations.
If the δ2 value for a given recombination rate c is known, four explicit unknowns remain in Eq. (1): the total metapopulation size (NT), the migration rate (m), the genetic differentiation index (FST), and the number of subpopulations (s). These variables are linked by the general equation for FST of Takahata33 (see Eq. A14 in the Supplementary Information), which reduces the number of unknowns to three. These can be solved using at least three independent parameters measured from the sample. After testing different combinations, we chose the measurements of δ2 for unlinked sites (c = 0.5; on different chromosomes) and for weakly linked sites (c > 0.05; on the same chromosome), and the inbreeding coefficient observed in the sample. The latter serves as an approximation for FST under the assumption of panmixia within subpopulations, and its combination with LD metrics increases the stability of parameter estimates. Santiago et al.21 showed that most of the linkage disequilibrium observed at high or intermediate recombination rates is due to drift in very recent generations. Assuming no drastic recent demographic changes, it is reasonable to propose that similar values of Ne (the current effective size), m, s, and FST are involved in the equation for the expected δ2 between sites on different chromosomes (area B in Supplementary Fig. 1) and in a second equation for the expected δ2 between distant sites on the same chromosome (area A in Supplementary Fig. 1). Consequently, these two equations, together with Takahata’s general equation33 for FST and the observed inbreeding value, jointly estimate the four unknowns through a numerical optimization that minimizes the sum of squares of the differences between observed and predicted δ2 for the two sets of sites. This procedure is implemented in GONE2, which always requires a genetic map, and in currentNe2, which operates without restrictions on genetic distances within chromosomes when no map is available.
GONE2, like its predecessor, uses a hidden Markov process to estimate the historical Ne series under the assumption of a single panmictic population (the default option). It compares the observed LD across recombination bins with the predicted LD derived from proposed demographic histories, ultimately identifying the history that best fits the LD observations across all bins. However, to account for metapopulations in the Markov process, temporal migration rates must be included as hidden parameters, complicating the search for a solution. To address this challenge, GONE2 uses an approach inspired by Tenesa et al. 34, which assumes that the LD between loci with recombination rate c reflects the Ne of 1/(2c) generations ago, assuming linear changes in Ne10. After substituting the estimates of m, s, and FST, calculated as described above, and the observed δ2 value for a given recombination bin into Eq. (1), this method generates a Ne estimate for the c value of the bin. LD of bins with lower c values correspond to Ne estimates deeper in the past. While this approach is computationally efficient in complex metapopulation scenarios, it provides only an approximate demographic trend as it does not take into account that the LD corresponding to a particular bin is influenced by the entire demographic history of the population, as GONE2 does when panmixia is assumed.
Correction for base-calling errors
In a two-locus biallelic model, genotyping errors at one locus replace one allele with the other, inducing a new covariance of opposite sign. Let Di,j be the true covariance between loci i and j in the population, and ε be the probability of genotyping error per base read. The expected covariance after genotyping is the sum of the remaining original covariance and the new covariance:
The pre-genotyping variance at a locus i with allele frequencies pi and is . Therefore, the expected post-genotyping variance at locus i is
These equations give the deterministic expectations for and for in the population. Assuming sampling with replacement over these expectations, the finite sampling corrections are derived (see Section 1.10 of the Supplementary Information). Even with the above corrections, the presence of genotyping errors adds noise to the estimates of LD, and represents a major handicap in estimating the small values of LD for unlinked and weakly linked loci. Consequently, the consideration of genotyping errors has been excluded from currentNe2 and also from the calculation of LD by GONE2 for subdivided populations, both assuming high quality of genotyping.
Non-parametric solution for low sequencing depth
To address the challenge of low sequencing depth in diploid organisms, which can lead to increased observed homozygosity and biased LD measurements, GONE2 uses the pseudohaploid theory developed in Section 1.9 of the Supplementary Information. This approach assumes no intrinsic allele preference in the sequencing method at heterozygous sites. The software generates pseudohaploid genomes for each diploid individual in the sample by randomly selecting one allele at each observed heterozygous site35. GONE2 then estimates the historical Ne using these pseudohaploid samples. To increase accuracy, this process is repeated fifty times, with the partial estimates averaged to produce a final, corrected estimate of historical Ne. This method effectively accounts for variable sequencing depth across the genome, allowing for differences in sequencing depth both between individuals and within genomes. For the same reasons as for genotyping error, the implementation of the correction for low sequencing depth is only included in GONE2 when panmictic populations are assumed.
Checking predictions with simulated and empirical data
Figure 1 shows currentNe2 estimates of key metapopulation parameters under different island model scenarios, including deviations from equal deme sizes and sampling. The metapopulation analysis, invoked with the ‘-x’ option, generally provides accurate Ne estimates under all scenarios. However, migration rate estimates become less reliable at low deme differentiation, while FST is underestimated at very low migration rates (Nm « 1, where N is the subpopulation size). When sampling from a single subpopulation, both analytical approaches (default option and ‘-x’ option) yield similar estimates of the effective size of the subpopulation (Fig. 1C). It is notable that, when population subdivision is assumed, the estimates of Ne of the total metapopulation remain close to the true values regardless of differences in subpopulation sizes, even under extreme asymmetries (Fig. 1D).
Fig. 1. currentNe2 estimates in different simulated scenarios.
The top plot in each panel shows estimates of contemporary effective population size (Ne) for the entire metapopulation (blue dots), the sum of the effective sizes of the subpopulations (NT, red dots), and Ne assuming panmixia (green squares; green arrows indicate values below the scale limit). Note that the labels ‘N’ on the x-axes here refer generically to the three estimates. The three lower plots show estimates for migration rates (m), genetic differentiation indices (FST), and the number of subpopulations (s). All estimates were calculated using the currentNe2 under the assumption of population subdivision (option ‘-x’), except for Ne under panmixia. Each estimate represents the geometric mean of ten simulated metapopulations, with 95% confidence intervals. True metapopulation values are indicated by grey dashed lines (Ne and NT lines often overlap, with Ne typically higher). A Effect of varying migration rates in a metapopulation with two subpopulations of 1000 individuals each. B Effect of increasing the number of equally sized subpopulations while maintaining a total metapopulation size of 2000 individuals (m = 0.001). C Effect of unequal sampling proportions between two subpopulations of 1000 individuals each (m = 0.001). D Effect of unequal subpopulation sizes in a metapopulation with two subpopulations totalling 2000 individuals (m = 0.001). All estimates are based on random samples of 100 individuals from the entire metapopulation, except in (C), where sampling proportions vary. Source data are provided as a Source Data file.
Assuming a single panmictic population (the default option) gives the same estimates as the previous version of currentNe21: When analyzing a random sample from the entire metapopulation, this leads to large underestimates of Ne unless migration rates are so high (Nm » 1) that the metapopulation effectively behaves as a single panmictic population. These results suggest that comparing Ne estimates assuming metapopulation structure (the ‘-x’ option) with those assuming panmixia (the default option) can help to identify population structure: similar Ne estimates using both options indicate a panmictic population, while lower Ne estimates using the default option indicate subpopulation differentiation. In the latter case, the ‘-x’ option should be used to estimate Ne. These results hold even with significant departures from the island model, such as unequal deme sizes and asymmetric migration (Supplementary Fig. 2). Estimates remain robust for the continent-island and the stepping stone models, except for less accurate subpopulation number estimates in the latter.
Supplementary Table 3 shows that for panmictic populations, Ne estimates with and without the ‘-x’ option have overlapping 90% confidence intervals, indicating no significant difference. However, for highly structured populations, these estimates diverge significantly. The threshold for detecting metapopulation structure appears to be around Nm = 10 (Supplementary Table 4), highlighting the sensitivity of LD between unlinked and weakly linked sites to population differentiation.
Figure 2 shows GONE2 estimates for different simulated scenarios. For panmictic populations (row 1), both the default and ‘-x’ options give similar estimates for recent generations, but the ‘-x’ option fails to accurately capture older demographic changes. This suggests that the default option, which gives the same results as the previous version of GONE18, is preferable for panmictic populations or weakly differentiated subpopulations. In metapopulation scenarios (row 2), the default option incorrectly indicates a recent decline in size, while the ‘-x’ option corrects this bias but only captures general demographic trends. Additional comparisons with HapNe-LD13 estimates (Supplementary Fig. 3) show that GONE2 with the ‘-x’ option performs better in terms of accuracy and trend detection under constant and variable demographic scenarios.
Fig. 2. GONE2 estimates of the historical Ne in different simulated scenarios.
Four different profiles of demographic change are represented in the columns by the grey-shaded areas: constant population size, recent decline, recent expansion, and bottleneck. The scenarios are also arranged in rows in four different situations. First row: Estimates from panmictic populations using the default option of the program (green lines) and the ‘-x’ option, which incorrectly assumes that the population is divided in two subpopulations (red lines). Second row: Estimates from metapopulations composed of two subpopulations of equal size N and migration rate m = 0.001 per generation. The analyses consider either a metapopulation divided into two subpopulations (option ‘-x’, red lines) or the incorrect assumption of a single panmictic population (default program options, green lines). Third row: Estimates from low depth of sequencing data (average depth 2x) of panmictic populations. Green lines show estimates not corrected for low sequencing depth (default program options), while red lines show estimates corrected for low sequencing depth (option ‘-g 3’ to be used for any sequencing depth). Fourth row: Estimates from sequencing data with 5% base calling errors. Green lines represent unadjusted estimates not corrected for errors (program default option), while red lines represent estimates corrected for the true 5% error rate (option ‘-b 0.05’). Simulation results are the geometric mean of 20 replicates. The shaded areas around the estimate lines represent the 95% interval of the distribution of the estimates. Source data are provided as a Source Data file.
Table 1 compares Ne estimates with a wide range of sample sizes across different animal species, generally indicating subpopulation differentiation. This was to be expected for multi-breed samples, with the smallest difference in the sample mix of the two closely related breeds, Gordon and English Setters. To varying degrees, the gap between the two Ne estimates, assuming panmixia (default) and assuming structure (option ‘-x ‘) is clear in all natural populations, except for the two salmon samples, for which the 90% CIs assuming panmixia and assuming structure are close. Single-breed or experimental population samples show similar Ne estimates between methods, with minor differences for horse and turbot. There is a fairly clear linear relationship between the ratio of the two estimates and the migration rate estimate (Supplementary Fig. 4). This is somewhat to be expected as both estimates depend on the inverse of the LD. In differentiated subpopulations, assuming panmixia, the LD between unlinked loci is dominated by the square of the FST, which is quite proportional to the migration rate. However, this dependence on the FST is eliminated from the Ne estimate when structure is assumed. This difference leads to a proportionality of the ratio to the migration rate.
Table 1.
currentNe2 estimates with samples from different species
| Estimates Assuming Panmixia | Estimates Assuming Structure | |||||||
|---|---|---|---|---|---|---|---|---|
| Species/Population/Sample | n (v) | Ne | CI | Ne | CI | s | m | FST |
| Boar (S. scrofa) wild boars from the island of Sardinia53 | 99 (33) | 55 | 51–60 | 888 | 719–1096 | 13 | 0.01920 | 0.16243 |
| Cattle (B. taurus) 134 cattle breeds sampled worldwide54 | 1543 (9) | 12 | 12–12 | 2241 | 2214–2268 | 5 | 0.00170 | 0.21045 |
| Deer (O.virginianus) sampled throughout USA and Canada55 | 43 (100) | 37 | 35–39 | 64,825 | 24,897–168,786 | 6 | 0.00011 | 0.15176 |
| Dog (Canis lupus familiaris) Gordon and English Setters56 | 261 (109) | 42 | 42–43 | 94 | 92–97 | 2 | 0.03054 | 0.04345 |
| Flycatcher (F. albicollis) sampled in the island of Öland57 | 864 (19) | 830 | 823–838 | 6732 | 6376–7108 | 2 | 0.00110 | 0.01684 |
| Goat (C. hircus) 15 breeds from Italy and 26 from Pakistan58 | 929 (29) | 21 | 21–21 | 40,421 | 35,293–46,294 | 6 | 0.00014 | 0.17381 |
| Gorilla (G.gorilla - West Lowland), mostly from Cameroon59 | 14 (99) | 73 | 46–117 | 2394 | 456–12,568 | 7 | 0.00551 | 0.09748 |
| Horse (E. caballus) Egyptian Arabian breed60 | 36 (15) | 14 | 12–16 | 21 | 18–23 | 2 | 0.12218 | 0.04927 |
| Orca (O. orca) sampled in the eastern Canadian High Arctic61 | 16 (100) | 42 | 31–57 | 1341 | 434–4138 | 2 | 0.00214 | 0.04360 |
| Pig (S. domesticus) 6 breeds from Italy and 5 worldwide53 | 105 (37) | 18 | 17–19 | 207 | 186–229 | 10 | 0.03904 | 0.25113 |
| Salmon (S. salar) from Baddoch, tributary of the river Deea | 16 (158) | 227 | 128–405 | 507 | 233–1102 | 2 | 0.01317 | 0.01874 |
| Salmon (S. salar) from Girnock, tributary of the river Deea | 16 (152) | 221 | 125–394 | 491 | 228–1060 | 2 | 0.00969 | 0.02625 |
| Seabass (D. labrax) from the FMD breeding programme49 | 65 (3) | 57 | 51–63 | 55 | 49–61 | 2 | 0.06608 | 0.03447 |
| Seabream (S. aurata) Andromeda breeding programme49 | 117 (9) | 80 | 73–87 | 65 | 60–70 | 2 | 0.07031 | 0.02749 |
| Seabream (S. aurata) from the FMD breeding programme49 | 107 (22) | 65 | 60–71 | 28 | 26–29 | 2 | 0.49994 | 0.00902 |
| Sheep (O. aries) 8 breeds from Algeria62 | 46 (43) | 175 | 138–222 | 1572 | 916–2697 | 9 | 0.01638 | 0.06906 |
| Turbot (S. maximus) CETGA experimental population49 | 46 (16) | 62 | 54–71 | 99 | 85–350 | 2 | 0.02065 | 0.06114 |
Estimates of contemporary effective population sizes (Ne), 90% confidence intervals (CI), number of subpopulations (s), migration rates (m) and fixation index (FST) obtained by currentNe2 from empirical animal data (n: number of individuals in the sample; v ×103: number of SNPs). Estimates assume either geographic structure (option ‘-x’) or panmixia (default option).
aData provided by John Taggart (Institute of Aquaculture, University of Stirling) and available at https://github.com/esrud/currentNe2/tree/main/examples; Assumed rates of recombination of 1 cM/Mb for all species except for Gorilla (1.18), Seabass (2.38), Seabream (2.13), and Turbot (2.47).
Contemporary Ne estimates using currentNe2 can be combined with historical Ne estimates using GONE2 (Fig. 3) to infer the recent past demography. The demographic histories of the two salmon populations and the domestic populations of seabass and seabream, which are found to be essentially panmictic, are better represented by the GONE2 predictions assuming panmixia (green lines), while the prediction assuming structure (option ‘-x’) shows only the general demographic trend. For the other species, the trend resulting from the structure assumption analysis is the best option, especially for those with large differences in estimates from Table 1.
Fig. 3. Historical Ne estimates for different species using GONE2.
Estimates of Ne trajectories over the last 50 generations for the same samples analyzed in Table 1. Each panel corresponds to a different species, with estimates obtained using GONE2 under two assumptions: the default option (green lines), which assumes panmixia, and the ‘-x’ option (red lines), which takes population structure into account. The salmon panel combines the analyses of two tributaries of the river Dee. Seabream panel combines the analysis from two parallel breeding programmes. GONE2 did not produce results for cattle for more than five generations, probably due to the complexity of the mixing of 134 highly differentiated breeds. Source data are provided as a Source Data file.
GONE2 now addresses biases in Ne estimates from low quality DNA. Direct analysis of low-depth sequencing or error-prone genotyping data inflates historical Ne estimates, but appropriate corrections effectively mitigate these biases (Fig. 2, rows 3 and 4). The genotyping error correction requires known error rates, which can be estimated in some contexts28,36, whereas the sequencing depth correction is adaptable to any depth.
Figure 4 shows Ne estimates from autosomes and from X-chromosome sequencing data of Drosophila males from four laboratory populations37 using the new haploid analysis option of GONE2. These estimates (at the diploid scale) tend to be higher than those from autosome data of the same males, especially in the most recent generations, for which Ne is generally estimated at higher resolution. This suggests that despite the equal number of sexes imposed by management, the effective number of reproducing males was lower than the number of females, leading to an increased representation of X chromosomes and higher diploid census estimates after correction (see Methods).
Fig. 4. Estimates of the historical Ne using GONE2 with samples from 17 males of Drosophila melanogaster.
The experimental populations were maintained at constant size (A), underwent a recent drastic reduction in size (B), recovered from a previous bottleneck (C), and underwent further expansion after a bottleneck (D), as shown by the grey shaded areas. The green lines show the estimates of Ne from autosomes using the modifier ‘-g 0’ for unphased diploid genotypes. The red lines show the estimates of Ne from X chromosomes using the haploid option ‘-g 1’. The Ne estimates from X chromosomes have been transformed to the autosomal scale (see Methods) to compare sex ratios. Source data are provided as a Source Data file.
Discussion
GONE2 and currentNe2 now account for population subdivision in their estimates of effective population size, addressing a fundamental challenge in population genetics. Natural populations often exhibit some degree of structure that can significantly bias Ne estimates if not properly accounted for. The inclusion of genetically distinct individuals from multiple demes in a single sample amplifies observed linkage disequilibrium38, analogous to a two-locus version of the Wahlund effect39. Neglecting population structure introduces an artefact in temporal Ne estimates, characterized by an apparent sharp decline in the generations closest to the sampling time18,24,40, which also affects contemporary Ne estimation tools20,21. If the ‘-x’ option yields larger Ne estimates for current generations than estimates with the default option, it serves as an indicator of population subdivision. This has implications for conservation genetics, as populations previously deemed at risk of extinction (Ne < 500)26 may in fact have larger Ne values if population subdivision is properly accounted for in the estimation.
While Ragsdale and Gravel27 have comprehensively described the LD evolution in multi-population systems, the development of a computationally efficient method to estimate recent historical Ne of metapopulations from a single sample of individuals has remained elusive. Our approach addresses this problem by combining three observations from a single sample: LD of unlinked loci, LD of weakly linked loci and the average inbreeding coefficient. Under the island model, we estimate five parameters: the effective size of the metapopulation (Ne), the sum of the effective sizes of the subpopulations (NT), the genetic differentiation index (FST), the migration rate (m), and the number of subpopulations (s). These parameters are reduced to three unknowns by two key relationships: Wright’s32 ratio and Takahata’s33 FST equation, the latter linking all parameters except Ne at migration-drift equilibrium. This system of equations yields a computationally tractable solution with remarkable robustness. It provides accurate contemporary estimates of Ne even when key assumptions are violated, such as deviations from the island model, unequal sampling, or heterogeneous subpopulation sizes. Migration rate estimates are also accurate when subpopulation differentiation is high. However, when Nm » 1 (where N is the subpopulation size), migration rates tend to be underestimated, probably due to the inherent difficulty in achieving precision as FST values approach zero. Notably, the method shows accuracy in estimating subpopulation numbers, except in stepping stone model scenarios.
Our research reveals a compelling relationship: the linkage disequilibrium (δ2) between loci on different chromosomes (c = 0.5) closely approximates the ratio between the square of the FST and the number of subpopulations. This finding lies in the core of the method and provides a way of estimating the migration rate from a single sample of individuals. The approach complements existing techniques, such as those proposed by Waples41 and Zhivotovsky42, which primarily use deviations from the Hardy-Weinberg equilibrium within a sample.
If the migration rate is large (e.g. Nm > 10), sampling from a single subpopulation will approximate the estimate for the whole metapopulation. However, analyzing samples from a single subpopulation within a highly differentiated metapopulation is very similar to analyzing a panmictic population with the size of the subpopulation, as noted by Waples and England22. In this case, the default analysis option in GONE2 or currentNe2 demonstrates remarkably robustness in estimating the effective size of the subpopulation, a finding further supported by Novo et al.24. Notably, the ‘-x’ option, designed to account for metapopulation structure, does not improve resolution in such scenarios. Instead, it may introduce unnecessary complexity, potentially obscuring the true demographic patterns of the sampled subpopulation. This observation underscores the importance of understanding the sampling context when choosing the method of analysis, and highlights that the more complex metapopulation model is not always advantageous, particularly when dealing with samples from a single, relatively isolated subpopulation within a broader metapopulation framework. In this context, comparing confidence intervals of estimates using currentNe2 could be helpful in determining the most appropriate model when the population structure is unknown or the origin of the samples is unclear. Applying this approach to the set of species in this study suggests a general interpretation: natural populations typically exhibit strong population structures (i.e. Nm ≪ 10). The salmon populations from the river Dee may be an exception, although their classification as truly natural populations is debatable due to restoration management practices. For domestic species, analyses of samples containing a mixture of breeds consistently show clear separation of confidence intervals using currentNe2. Conversely, samples from pure breeds or single managed populations tend to show overlapping or nearly overlapping intervals.
GONE2 now addresses two key challenges related with low-quality DNA genotyping: low sequencing coverage and base calling errors. These issues can artificially inflate Ne estimates due to allele detection failures. The software incorporates robust corrections that, when properly applied, effectively mitigate these biases. The sequencing depth solution is particularly versatile, adapting to various depth distributions without parametric constraints, ensuring accurate Ne estimation across diverse data quality scenarios. Furthermore, GONE2’s new capability to analyze haploid data significantly broadens its applicability in genetic studies. This feature is particularly valuable for research on haploid species, organisms with haplodiploid sex determination systems, and for investigating sex ratios in diploid species.
By accounting for population structure and genotyping error, this framework extends the operational scope of demographic inference in both natural and managed populations. This is particularly relevant for non-model species, since a precise genetic map is not required for the analysis. Future integrations with environmental covariates could further enhance the ecological relevance of Ne estimation, contributing to its transformation from a population genetic abstraction into a practical conservation metric.
Methods
Working with the software
GONE2 and currentNe2 are C++ programs designed for Linux environments, using a command line interface. These tools use a user-friendly syntax: ‘gone2 <modifiers> filename’ and ‘currentne2 <modifiers> filename’, where filename represents the input sample data file. The programs support the VCF format43, and the PED or TPED formats44. GONE2 processes genotyping data to compute observed d2 values in bins of recombination rate c between SNP pairs. Since PED files do not contain genetic map information, locations must be available in an accompanying map file in PLINK format. A genetic map can be approximated by a physical map if a whole-genome recombination rate is provided to the program (option ‘-r’). CurrentNe2 uses the general Eq. (1) in Santiago et al. 21, which takes into account the mating structure. If no information on marker locations are available in the input files, it performs a single estimate of contemporary Ne assuming that markers are evenly distributed across the genome. If marker assignments to chromosomes are available, it additionally provides estimates using the observed δ2 values between sites on different chromosomes. In addition, if the genetic locations of the markers are available, currentNe2 will use them in the estimates, otherwise, it would convert physical locations to genetic locations by assuming a constant recombination rate across the genome (option ‘-r’). Both programs offer the ‘-x’ modifier for metapopulation structure analysis, which is based on Eq. (1) as explained before. The algorithm shown in Supplementary Fig. 5 is used to estimate the three relevant parameters N (the subpopulation size), s and m. FST is calculated from these values using the equation of Takahata33. The total population size and the effective population size of the metapopulation are calculated as and respectively. GONE2 introduces additional features to handle different scenarios: base calling errors with the ‘-b error_rate’ modifier, low sequencing depth with the ‘-g 3’ modifier and haploid populations with the ‘-g 1’ modifier. Further details of the software implementations can be found in their respective online repositories.
GONE2 does not generate confidence intervals for Ne estimates. However, for datasets with a large number of chromosomes, empirical confidence limits can be obtained using subsets of chromosomes. These intervals should be interpreted with caution, as they do not account for pedigree sampling effects in small samples. Alternatively, when the sample size is sufficiently large, confidence intervals can be obtained empirically by generating replicate estimates from individual subsamples. In contrast, currentNe2 generates confidence intervals for Ne estimates under panmixia using the approach of Santiago et al.21, which is also applied to subdivided populations for guidance.
Computer simulations
To test the new features of the software we used the SLiM v3 software45. The genomes generally consisted of 20 chromosomes, each 100 Mb and 100 cM long, with neutral mutations occurring at a rate between 1.4 and 17 × 10–9, resulting in ~50,000 SNPs available for analysis in each sample. We ran simulations for 10,000 discrete generations with different population sizes depending on the scenario. At the end of the simulation, 100 individuals were sampled to estimate Ne. In some of the scenarios, base calling errors were introduced at a rate of 5% by randomly replacing one allele with the other. To simulate low coverage, we converted heterozygotes to homozygotes at a rate of 1/2, which is roughly equivalent to an average read depth of 2× after filtering out sites with no reads.
Empirical analyses
GONE2 was tested with sequencing data from four samples, each consisting of 17 males, from four laboratory populations of Drosophila melanogaster provided by Novo et al.37. These populations were maintained with controlled numbers of adults (40–50 individuals of each sex per vial), either constant or with recent significant changes in size. We estimated historical haploid Ne using the haploid option ‘-g 1 ‘ of GONE2 with X chromosome data from these males. The genetic map, which is based on female meiosis, was corrected by reducing the recombination rates by 2/3 (males only carry one copy, so 1/3 of chromosomes do not recombine). This was done to calculate the effective genetic distances for X chromosomes. The recombination rates of autosomes were corrected by multiplying by 1/2 because meiosis of Drosophila males is achiasmatic (males carry two copies, so 2/4 of the chromosomes do not recombine). For comparison with autosomal results from the same males in order to get sex ratios, these haploid Ne estimates from X chromosomes were rescaled by multiplying by 4/3, to obtain the haploid equivalent in autosomes with equal sex numbers, and dividing by 2 to restore the diploid number. The number of SNPs available for analysis ranged from 85,767 to 143,742 across the four samples.
We used currentNe2 and GONE2 to estimate contemporary and historical Ne for different animal species, comparing results assuming geographic structure (option ‘-x’) with those assuming panmixia (default option). Genotyping data were obtained from supplementary material of the original publications (Table 1), typically as VCF or PED files containing SNP genotypes and locations. However, for gorillas, orcas, and deer only fastq sequencing data were available, which were processed using Trimmomatic46 for trimming, and minimap247 for mapping to reference genomes (gorilla: assembly GCF_029281585.2; deer: assembly GCA_014726795.1; orca: assembly CNA0050865). The SAMtools and BCFtools utilities48 were used to filter unmapped reads and duplicates (flags ‘-F 1804’), calculate genotype likelihoods (quality options ‘-Q 20 -q 20’), perform variant calling (multiallelic) and additional filtering (-e ‘DP < 20||DP > 2*MEAN(DP) || AD[GT] <= 5’), excluding SNPs with missing genotypes. Chromosomes or scaffolds smaller than 20 Mb were discarded. In the absence of species-specific genetic maps, a uniform recombination rate of 1 cM/Mb (option ‘-r 1’) was applied, except for turbot (2.47 cM/Mb), seabream (2.13 cM/Mb), seabass (2.38 cM/Mb) 49, and gorilla (1.19 cM/Mb)50.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Supplementary information
Source data
Acknowledgements
This study forms part of the Marine Science Programme (ThinkInAzul) supported by the Ministerio de Ciencia e Innovación and Xunta de Galicia with funding from the European Union NextGenerationEU (PRTR-C17.I1) and European Maritime and Fisheries Fund (A.C.). We also acknowledge financial support from grants PID2020-114426GB-C21 (MCIN/AEI/10.13039/501100011033) (A.C., E.S.), Xunta de Galicia (ED431C 2024/22) (A.C.), Centro Singular de Investigación de Galicia accreditation 2024-2027 (ED431G 2023/07) and “ERDF A way of making Europe” (A.C.). We thank Mary Riádigos for administrative support.
Author contributions
E.S. and A.C. conceived the work and wrote the manuscript. E.S. developed the theory. E.S. and C.K. developed the software. A.C. conducted simulations and analyses. C.K. led the bioinformatics processing. All authors revised the manuscript.
Peer review
Peer review information
Nature Communications thanks Joshua Schraiber and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available.
Data availability
The individual data points corresponding to the figures in the main text, along with links to all relevant datasets and accession codes used in this study, are detailed in the supplementary file Source_Data.xlsx. Scripts for SLiM simulations can be accessed on the GitHub address https://github.com/esrud/currentNe2/blob/main/slim_simulation_inputs. Source data are provided with this paper.
Code availability
The code of the software programmes GONE2 and currentNe2 developed and used to perform the analyses and generate results in this study are available at GitHub (https://github.com/esrud/GONE251 and https://github.com/esrud/currentNe252), under a GPL-3.0 license. Users are permitted to reuse, modify, and distribute the code in accordance with the terms of the license.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
The online version contains supplementary material available at 10.1038/s41467-025-61378-w.
References
- 1.Wright, S. Evolution in Mendelian populations. Genetics16, 97–159 (1931). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Frankham, R., Ballou, J. D. & Briscoe, D. A. Introduction to Conservation Genetics 2nd ed (Cambridge University Press, Cambridge, U.K., 2010).
- 3.Caballero, A. Quantitative Genetics (Cambridge University Press, 2020).
- 4.Waples, R. S. A generalized approach for estimating effective population size from temporal changes in allele frequency. Genetics121, 379–391 (1989). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Tallmon, D. A., Koyuk, A., Luikart, G. & Beaumont, M. A. ONeSAMP: a program to estimate effective population size using approximate Bayesian computation. Mol. Ecol. Resour.8, 299–301 (2008). [DOI] [PubMed] [Google Scholar]
- 6.Gilbert, K. J. & Whitlock, M. C. Evaluating methods for estimating local effective population size with and without migration. Evolution69, 2154–2166 (2015). [DOI] [PubMed] [Google Scholar]
- 7.Wang, J., Santiago, E. & Caballero, A. Prediction and estimation of effective population size. Heredity117, 193–206 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Atkinson, Q. D., Gray, R. D. & Drummond, A. J. mtDNA variation predicts population size in humans and reveals a major Southern Asian chapter in human prehistory. Mol. Biol. Evol.25, 468–474 (2008). [DOI] [PubMed] [Google Scholar]
- 9.Schiffels, S. & Durbin, R. Inferring human population size and separation history from multiple genome sequences. Nat. Genet.46, 919–925 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Hayes, B. J., Visscher, P. M., McPartlan, H. C. & Goddard, M. E. Novel multi- locus measure of linkage disequilibrium to estimate past effective population size. Genome Res.13, 635–643 (2003). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Palamara, P. F., Lencz, T., Darvasi, A. & Pe’er, I. Length distributions of identity by descent reveal fine-scale demographic history. Am. J. Hum. Genet.91, 809–822 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Browning, S. R. & Browning, B. L. Accurate non-parametric estimation of recent effective population size from segments of identity by descent. Am. J. Hum. Genet.97, 404–418 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Fournier, R., Tsangalidou, Z., Reich, D. & Palamara, P. F. Haplotype-based inference of recent effective population size in modern and ancient DNA samples. Nat. Commun.14, 7945 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Nadachowska-Brzyska, K., Konczal, M. & Babik, W. Navigating the temporal continuum of effective population size. Methods Ecol. Evol.13, 22–41 (2022). [Google Scholar]
- 15.Hill, W. G. & Robertson, A. Linkage disequilibrium in finite populations. Theor. Appl. Genet.38, 226–231 (1968). [DOI] [PubMed] [Google Scholar]
- 16.Sved, J. A. & Hill, W. G. One hundred years of linkage disequilibrium. Genetics209, 629–636 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Kang, J. T. L. & Rosenberg, N. A. Mathematical properties of linkage disequilibrium statistics defined by normalization of the coefficient D = pAB – pApB. Hum. Hered.84, 127–143 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Santiago, E. et al. Recent demographic history inferred by high-resolution analysis of linkage disequilibrium. Mol. Biol. Evol.37, 3642–3653 (2020). [DOI] [PubMed] [Google Scholar]
- 19.Waples, R. S. A bias correction for estimates of effective population size based on linkage disequilibrium at unlinked gene loci. Conserv. Genet.7, 167–184 (2006). [Google Scholar]
- 20.Do, C. et al. NeEstimator V2: re-implementation of software for the estimation of contemporary effective population size (Ne) from genetic data. Mol. Ecol. Resour.14, 209–214 (2014). [DOI] [PubMed] [Google Scholar]
- 21.Santiago, E., Caballero, A., Köpke, C. & Novo, I. Estimation of the contemporary effective population size from SNP data while accounting for mating structure. Mol. Ecol. Resour.24, e13890 (2024). [DOI] [PubMed] [Google Scholar]
- 22.Waples, R. S. & England, P. R. Estimating contemporary effective population size on the basis of linkage disequilibrium in the face of migration. Genetics189, 633–644 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Arredondo, A. et al. Inferring number of populations and changes in connectivity under the n-island model. Heredity126, 896–912 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Novo, I. et al. Impact of population structure in the estimation of recent historical effective population size by the software GONE. Genet. Sel. Evol.55, 86 (2023a). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Fedorca, A. et al. Dealing with the complexity of effective population size in conservation practice. Evol. Appl.17, e70031 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Hoban, S. et al. Genetic diversity goals and targets have improved, but remain insufficient for clear implementation of the post-2020 global biodiversity framework. Conserv. Genet.24, 181–191 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Ragsdale, A. P. & Gravel, S. Models of archaic admixture and recent history from two-locus statistics. PLoS Genet.15, e1008204 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Schraiber, J. G. Assessing the relationship of ancient and modern populations. Genetics208, 383–398 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Ohta, T. & Kimura, M. Linkage disequilibrium due to random genetic drift. Genet. Res.13, 47–55 (1969). [Google Scholar]
- 30.Wright, S. The genetical structure of populations. Ann. Eugen.15, 323–354 (1951). [DOI] [PubMed] [Google Scholar]
- 31.Wang, J. & Caballero, A. Developments in predicting the effective size of subdivided populations. Heredity82, 212–226 (1999). [Google Scholar]
- 32.Wright, S. Isolation by distance. Genetics28, 114–138 (1943). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Takahata, N. Gene identity and genetic differentiation of populations in the finite island model. Genetics104, 497–512 (1983). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Tenesa, A. et al. Recent human effective population size estimated from linkage disequilibrium. Genome Res.17, 520–526 (2007). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Haak, W. et al. Massive migration from the steppe was a source for Indo-European languages in Europe. Nature522, 207–211 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Racimo, F., Renaud, G. & Slatkin, M. Joint estimation of contamination, error and demography for nuclear DNA from ancient humans. PLoS Genet.12, e1005972 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Novo, I., Pérez-Pereira, N., Santiago, E., Quesada, H. & Caballero, A. An empirical test of the estimation of historical effective population size using Drosophila melanogaster. Mol. Ecol. Resour.23, 1632–1640 (2023b). [DOI] [PubMed] [Google Scholar]
- 38.Nei, M. & Li, W. H. Linkage disequilibrium in subdivided populations. Genetics75, 213–219 (1973). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Kardos, M. & Waples, R. S. Low-coverage sequencing and Wahlund effect severely bias estimates of inbreeding, heterozygosity and effective population size in North American wolves. Mol. Ecol.24, e17415 (2024). [DOI] [PubMed]
- 40.Mazet, O., Rodríguez, W., Grusea, S., Boitard, S. & Chikhi, L. On the importance of being structured: instantaneous coalescence rates and human evolution – lessons for ancestral population size inference? Heredity116, 362–371 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.Waples, R. S. Testing for Hardy-Weinberg proportions: have we lost the plot?. J. Hered.106, 1–19 (2015). [DOI] [PubMed] [Google Scholar]
- 42.Zhivotovsky, L. A. Relationships between Wright’s FST and FIS statistics in a context of Wahlund effect. J. Hered.106, 306–309 (2015). [DOI] [PubMed] [Google Scholar]
- 43.Danecek, P. et al. The variant call format and VCFtools. Bioinformatics27, 2156–2158 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Chang, C. C. et al. Second-generation PLINK: rising to the challenge of larger and richer datasets. GigaScience4, s13742-015-0047-8 (2015). [DOI] [PMC free article] [PubMed]
- 45.Haller, B. C. & Messer, P. W. SLiM 3: Forward genetic simulations beyond the Wright-Fisher model. Mol. Biol. Evol.36, 632–637 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Bolger, A. M., Lohse, M. & Usadel, B. Trimmomatic: a flexible trimmer for Illumina sequence data. Bioinformatics30, 2114–2120 (2014). [DOI] [PMC free article] [PubMed]
- 47.Li, H. Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics34, 3094–3100 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Danecek, P. et al. Twelve years of SAMtools and BCFtools. GigaScience10, giab008 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Saura, M. et al. Estimates of recent and historical effective population size in turbot, seabream, seabass and carp selective breeding programmes. Genet. Sel. Evol.53, 85 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 50.Stevison, L. S. et al. The time scale of recombination rate evolution in great apes. Mol. Biol. Evol.33, 928–945 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Santiago, E. & Köpke, C. Accounting for population structure and data quality in demographic inference with linkage disequilibrium methods. https://github.com/esrud/GONE2, 10.5281/zenodo.15607090 (2025). [DOI] [PMC free article] [PubMed]
- 52.Santiago, E. & Köpke, C. Accounting for population structure and data quality in demographic inference with linkage disequilibrium methods. https://github.com/esrud/currentNe2, 10.5281/zenodo.15607092 (2025). [DOI] [PMC free article] [PubMed]
- 53.Iacolina, L. et al. Genomic diversity and differentiation of a managed island wild boar population. Heredity116, 60–67 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 54.Decker, J. E. et al. Worldwide patterns of ancestry, divergence, and admixture in domesticated cattle. PLoS Genet.10, e1004254 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55.Kessler, C. & Shafer, A. B. A. Genomic analyses capture the human-induced demographic collapse and recovery in a wide-ranging cervid. Mol. Biol. Evol.41, msae038 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 56.Dahlgren, S., Ziener, M. L. & Lingaas, F. A genome-wide association study identifies a region strongly associated with symmetrical onychomadesis on chromosome 12 in dogs. Anim. Genet.47, 708–716 (2016). [DOI] [PubMed] [Google Scholar]
- 57.Husby, A. et al. Genome-wide association mapping in a wild avian population identifies a link between genetic and phenotypic variation in a life-history trait. Proc. Biol. Sci.282, 20150156 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 58.Talenti, A. et al. Genomic analysis suggests KITLG is responsible for a roan pattern in two Pakistani goat breeds. J. Hered.109, 315–319 (2018). [DOI] [PubMed] [Google Scholar]
- 59.Prado-Martínez, J. et al. Great ape genetic diversity and population history. Nature499, 471–475 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60.Al Abri, M. A., König von Borstel, U., Strecker, V. & Brooks, S. A. Application of genomic estimation methods of inbreeding and population structure in an Arabian Horse. J. Hered.108, 361–368 (2017). [DOI] [PubMed] [Google Scholar]
- 61.Garroway, C. J. et al. Climate change introduces threatened killer whale populations and conservation challenges to the Arctic. Glob. Change Biol.30, e17352 (2024). [DOI] [PubMed] [Google Scholar]
- 62.Gaouar, S. B. et al. Genome-wide analysis highlights genetic dilution in Algerian sheep. Heredity118, 293–301 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The individual data points corresponding to the figures in the main text, along with links to all relevant datasets and accession codes used in this study, are detailed in the supplementary file Source_Data.xlsx. Scripts for SLiM simulations can be accessed on the GitHub address https://github.com/esrud/currentNe2/blob/main/slim_simulation_inputs. Source data are provided with this paper.
The code of the software programmes GONE2 and currentNe2 developed and used to perform the analyses and generate results in this study are available at GitHub (https://github.com/esrud/GONE251 and https://github.com/esrud/currentNe252), under a GPL-3.0 license. Users are permitted to reuse, modify, and distribute the code in accordance with the terms of the license.




