IdentityByDescentDispersal.jl: Inferring dispersal rates with identity-by-descent blocks

Francisco Campuzano Jiménez · 2025

Read IdentityByDescentDispersal.jl: Inferring dispersal rates with identity-by-descent blocks by Francisco Campuzano Jiménez (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-06964.txt.

Introduction

Francisco Campuzano Jimenez and co-authors present a software package in a 2025 paper on how far animals and plants spread across generations. Two key numbers in ecology and evolution are how dense a population is and how far offspring travel from their parents. Shared DNA segments inherited from a common ancestor, called identity-by-descent blocks, can reveal both numbers when mapped in space.

The package, written in the Julia language, follows a published inference scheme built on those shared blocks. It offers a friendly interface, fast gradient-based fitting, and room for custom population models through numeric integration. The authors hope easy tooling will draw more researchers to use spatial genetic data. Wider use, they argue, would grow the study of dispersal in wild populations.

Catalog record

CREATORFrancisco Campuzano Jiménez
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE10 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-06964

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

IdentityByDescentDispersal.jl: Inferring dispersal rates with identity-by-descent blocks Francisco Campuzano Jiménez Abstract K eywords population genetics • identity-by-descent • Julia 1 Summary The population density and per-generation dispersal rate of a population are central parameters in the study of evolution and ecology. The dispersal rate is particularly relevant for conservation management of fragmented or invasive species (Driscoll et al. 2014). There is a growing interest in developing statistical methods that exploit the increasingly available genetic data to estimate the effective population density and effective dispersal rate (Rousset 1997; Ringbauer, Coop, and Barton 2017; Chris C. R. Smith et al. 2023; Chris C. R. Smith and Kern 2023). The distribution of recent coalescent events between individuals in space can be used to estimate such quantities through the distribution of identity-by-descent (IBD) blocks (Ringbauer, Coop, and Barton 2017). An IBD block is defined as a segment of DNA that has been inherited by a pair of individuals from a common ancestor without being broken by recombination. Here we present IdentityByDescentDispersal.jl , a Julia package for estimating effective population densities and dispersal rates from observed spatial patterns of IBD shared blocks. 2 Statement of need Ringbauer, Coop, and Barton (2017) proposed an inference scheme for the estimation of effective population density and effective dispersal rate from shared IBD blocks. Despite their promising results, there is to this date no general-purpose software implementation of their method. In order to make the inference approach available to the broader audience of evolutionary biologists and conservation scientists, we present IdentityByDescentDispersal.jl , a Julia (Bezanson et al. 2017) package with an efficient and easy-to-use implementation of the method. The package implements the core equations proposed by Ringbauer, Coop, and Barton (2017) and can be used to perform composite likelihood-based inference using either maximum-likelihood estimation (MLE) or Bayesian inference. The method of Ringbauer, Coop, and Barton (2017) was limited to a family of functions for the change in effective population density over time of the form D_{e}(t)=Dt^{-\beta} , for which the theory was analytically tractable. In addition, in the paper describing the original approach, the authors used gradient-free optimization to calculate maximum likelihood estimates (MLEs). Our implementation makes two major software contributions. First, we admit composite likelihood calculations for arbitrary functions D_{e}(t) by evaluating the relevant integrals numerically through Gaussian quadrature rules (Johnson 2013). This significantly enlarges the space of biologically relevant models that can be fitted. Second, our implementation takes advantage of the powerful Julia ecosystem and the work of Geoga et al. (2022) to provide a version of the composite likelihood that is fully compatible with automatic differentiation (AD), including AD with respect to \beta . By having a fully AD-compatible composite likelihood, IdentityByDescentDispersal.jl can be used together with standard gradient-based optimization and sampling methods available in the Julia ecosystem, which are typically more efficient than gradient-free methods. Lastly, our package comes with a template to simulate synthetic datasets and a pipeline for end-to-end analysis from VCF files to final estimates. We believe it will encourage a broader audience to adopt the inference scheme proposed by Ringbauer, Coop, and Barton (2017), motivate further developments and expand its applications. 3 Overview IdentityByDescentDispersal.jl contains two main sets of functions. The first set has the prefix expected_ibd_blocks and allows users to calculate the expected density of IBD blocks per pair of individuals and per unit of block length for various demographic models by solving {\mathbb{E}[N_{L}|r,\theta]=\int_{0}^{\infty}G4t^{2}\exp(-2Lt)\cdot\Phi(t|r,\theta)\,dt} (1) where G is the length of the genome (in Morgan), t is time (generations in the past), L is the length of the block (Morgan) and r is the geographical distance in the present (at time t=0 ) between the two individuals. \Phi(t|r,\theta) is the instantaneous coalescence rate at time t of two homologous loci that are initially r units apart under the demographic model with parameters \theta . A slightly more complicated expression that accounts for chromosomal edges and diploidy is the default in IdentityByDescentDispersal.jl . The second set of functions has the prefix composite_loglikelihood and allows users to directly compute the composite likelihood of the data by assuming the observed number of IBD blocks whose lengths fall in a small bin [L,L+\Delta L] and are shared by a pair of individuals r units apart follows a Poisson distribution with mean \lambda=\mathbb{E}[N_{L}|r,\theta]\Delta L . IdentityByDescentDispersal.jl allows for three different parameterizations of the effective population density function: a constant density, a power-density, and a user-defined density (see Table 1 ). Table 1: IdentityByDescentDispersal.jl functions support three different parameterizations that are indicated by their respective suffixes. Function suffix D_{e}(t) formula Parameters Solver constant_density D_{e}(t)=D D,\ \sigma Analytically power_density D_{e}(t)=Dt^{-\beta} D,\ \beta,\ \sigma Analytically custom User-defined User-defined and \sigma Numerically The Julia package is accompanied by two additional resources. First, we provide a simulation template in SLiM for forward-in-time population genetics simulation in a continuous space with tree-sequence recording (Haller and Messer 2023; Haller et al. 2019). This template can be used to assess model assumptions, guide empirical analysis, and perform simulation-based calibration. Assessing the performance of the method with synthetic datasets is a crucial step, as it is known that errors in the detection of IBD blocks are common (S. R. Browning and Browning 2012) and that inferences based on composite likelihood tend to be overconfident, underestimating posterior uncertainty and yielding too narrow confidence intervals. Second, we have also implemented a bioinformatics pipeline that carries out a complete analysis from detecting IBD blocks to finding the MLE of the effective population density and the effective dispersal rate. It is shared as a Snakemake pipeline, a popular bioinformatics workflow management tool (Mölder et al. 2021). It takes as input a set of phased VCF files, their corresponding genetic maps and a CSV file containing pairwise geographical distances between individuals. The pipeline detects IBD blocks using HapIBD (Zhou, Browning, and Browning 2020), post-processes them with Refined IBD (B. L. Browning and Browning 2013) and produces a CSV file compatible with subsequent analysis with IdentityByDescentDispersal.jl via the preprocess_dataset function. Both the SLiM simulation template and the Snakemake pipeline can be found in the GitHub repository at https://github.com/currocam/IdentityByDescentDispersal.jl . 4 Example In this section, we demonstrate how IdentityByDescentDispersal.jl can be used together with the popular Turing.jl framework (Ge, Xu, and Ghahramani 2018) using a dataset we simulate in the documentation. We analyze error-free IBD blocks shared by 100 diploid individuals from a constant-density population with parameters D_{\text{true}}\approx 250 diploids/km 2 and \sigma_{\text{true}}\approx 0.071 km/generation. IdentityByDescentDispersal.jl has extensive documentation that covers the underlying theory behind the method, how to effectively simulate synthetic datasets, various demographic models, and inference algorithms. We refer the reader to the documentation for more details, which can be found at https://currocam.github.io/IdentityByDescentDispersal.jl/ . Thanks to Turing.jl , we can perform Bayesian inference with a wide range of popular Monte Carlo algorithms. Figure 1 shows the estimated pseudo-posterior obtained through doing inference with the composite likelihood. Figure 1: Estimated pseudo-posterior obtained by doing inference with the composite likelihood. The pseudo-posterior is forced to concentrate near the true values ( \mathbb{E}[D|\text{data}]\approx 281 and \mathbb{E}[\sigma|\text{data}]\approx 0.068 , respectively). Figure 1 was generated by the following snippet of Julia code, which reads the processed data CSV from the provided Snakemake pipeline. using CSV, DataFrames, Turing, StatsPlots, IdentityByDescentDispersal df = CSV. read (

Read the complete text