Easy-to-use R functions to separate reduced-representation genomic datasets into sex-linked and autosomal loci, and conduct sex assignment

Mol Ecol Resour. 2023 Aug 1. doi: 10.1111/1755-0998.13844. Online ahead of print.

Abstract

Identifying sex-linked markers in genomic datasets is important because their presence in supposedly neutral autosomal datasets can result in incorrect estimates of genetic diversity, population structure and parentage. However, detecting sex-linked loci can be challenging, and available scripts neglect some categories of sex-linked variation. Here, we present new R functions to (1) identify and separate sex-linked loci in ZW and XY sex determination systems and (2) infer the genetic sex of individuals based on these loci. We tested these functions on genomic data for two bird and one mammal species and compared the biological inferences made before and after removing sex-linked loci using our function. We found that our function identified autosomal loci with ≥98.8% accuracy and sex-linked loci with an average accuracy of 87.8%. We showed that standard filters, such as low read depth and call rate, failed to remove up to 54.7% of sex-linked loci. This led to (i) overestimation of population FIS by up to 24%, and the number of private alleles by up to 8%; (ii) wrongly inferring significant sex differences in heterozygosity; (iii) obscuring genetic population structure and (iv) inferring ~11% fewer correct parentages. We discuss how failure to remove sex-linked markers can lead to incorrect biological inferences (e.g. sex-biased dispersal and cryptic population structure) and misleading management recommendations. For reduced-representation datasets with at least 15 known-sex individuals of each sex, our functions offer convenient resources to remove sex-linked loci and to sex the remaining individuals (freely available at https://github.com/drobledoruiz/conservation_genomics).

Keywords: COLONY; bioinformatic filtering; molecular sexing; multilocus contigs; sex chromosomes; sex-linked loci.