KLinterSel: Intersection among candidates of different selective sweep detection methods
Detecting signals of natural selection, including selective sweeps, in genomic data often involves applying several methods in parallel. Regions identified by multiple approaches are usually considered strong candidates, as agreement among methods is often taken as supporting evidence. However, the extent to which such overlaps exceed random expectations is rarely evaluated formally. When genomic elements are not independent, coincident candidate sites may arise from the underlying structure of the data rather than from genuine methodological concordance. To address this problem, we introduce two complementary statistical tests designed to evaluate whether the observed overlap among candidate sites detected by different methods exceeds what would be expected by chance. The first is a fast parametric test based on a sequentially conditioned hypergeometric framework that evaluates k-way intersections among candidate sets across genomic windows. The second relies on Monte Carlo simulations and compares the observed inter-method distance profiles with those expected under random association, taking into account the empirical distribution of SNPs along the genome. By capturing different aspects of concordance, these approaches allow agreement among methods to be assessed across multiple spatial scales. Both tests are implemented in the program KLinterSel, which also identifies clusters of candidate sites detected by different selection-detection methods within a user-defined distance threshold. We illustrate its application using candidate loci associated with resistance of the common cockle (Cerastoderma edule) to the parasite Marteilia cochillia. The software is written in Python and is available on GitHub together with documentation and precompiled executables for major operating systems.