In this study we show the power of variational autoencoders (VAEs) for a variety of tasks relating to the interpretation and compression of genomic data. The unsupervised setting allows for detecting and learning of granular population structure and inferring of new informative latent factors, opening up an avenue for applications in dimensionality reduction, data simulation, population classification, imputation, and lossless genomic data compression. The latent spaces of VAEs are able to capture and represent clearly differentiated Gaussian-like clusters of similar genetic composition on a fine-scale with a relatively small number of SNPs as input. Furthermore, sequences can be decomposed into latent representations and reconstruction errors (residuals) providing a sparse representation that provides a means for efficient lossless compression.

Identifying genetic clusters can be important when performing genome-wide association studies and provides an alternative to self-reported ethnic labels, which are culturally constructed and vary according to the location and individual. A variety of unsupervised dimensionality reduction methods have been explored in the past for such applications, including PCA, MDS, t-SNE, and UMAP. Our proposed VAE can represent the population structure as a Gaussian-distributed continuous multi-dimensional representation and as classification probabilities providing flexible and interpretable population descriptors.

We train our VAE method with several worldwide whole genome datasets from both humans and canids and evaluate the performance of the different proposed applications with networks with and without ancestry conditioning. Our experiments show that different population groups have significantly differentiated compression ratios and classification accuracies. Additionally, we analyze the entropy of the SNP data, noting its effect on compression across populations and connect these patterns to historical migrations and ancestral relationships.

 Video from the related BSc thesis at UPC Data Science Engineering (2021):