Learn R Programming

admixr—interactive R interface for ADMIXTOOLS

What is admixr?

The admixr package provides a convenient R interface to ADMIXTOOLS, a widely used software package for calculating admixture statistics and testing population admixture hypotheses.

A typical ADMIXTOOLS workflow often involves a combination of sed/awk/shell scripting and manual editing to create different configuration files. These are then passed as command-line arguments to one of ADMIXTOOLS commands, and control how to run a particular analysis. The results of such computation are then usually redirected to another file, which needs to be parsed by the user to extract values of interest, often using command-line utilities again or by manual copy-pasting, and finally analysed in R, Excel or another program.

This workflow can be a little cumbersome, especially if one wants to explore many hypotheses involving different combinations of populations or data filtering strategies. Most importantly, it makes it difficult to follow the rules of best practice for reproducible science, especially given the need for manual intervention on the command-line or custom shell scripting to orchestrate more complex pipelines.

admixr makes it possible to perform all stages of an ADMIXTOOLS analysis entirely from R. It provides a set of convenient functions that completely remove the need for "low-level" configuration of individual ADMIXTOOLS programs, allowing users to focus on the analysis itself.

How to cite

admixr is now published as an Application Note in the journal Bioinformatics. If you use it in your work, please cite the paper! You will join an excellent company of papers who have used it to do amazing research.

Copy Link

Version

Install

install.packages('admixr')

Monthly Downloads

490

Version

0.9.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Petr

Last Published

November 22nd, 2025

Functions in admixr (0.9.2)

read_ind

Read an EIGENSTRAT ind/snp/geno file.
read_output

Read an output file from one of the ADMIXTOOLS programs.
qpAdm_rotation

Fit qpAdm models based on the rotation strategy described in Harney et al. 2020 (bioRxiv)
qpWave

Find the most likely number of ancestry waves using the qpWave method.
download_data

Download example SNP data.
print.EIGENSTRAT

EIGENSTRAT print method
eigenstrat

EIGENSTRAT data constructor
count_snps

Count the number/proportion of present/missing sites in each sample
f4ratio

Calculate the D, f4, f4-ratio, or f3 statistic.
%>%

Pipe operator
filter_bed

Filter EIGENSTRAT data based on a given BED file
loginfo

Print the full log output of an admixr wrapper to the console.
merge_eigenstrat

Merge two sets of EIGENSTRAT datasets
print.admixr_result

Print out the admixr result object (dataframe or a list) without showing the hidden attributes.
qpAdm_filter

Filter qpAdm rotation results for only 'sensible' models
qpAdm

Calculate ancestry proportions in a set of target populations.
reset

Reset modifications to an EIGENSTRAT object
relabel

Change labels of populations or samples
transversions_only

Remove transversions (C->T and G->A substitutions)
write_ind

Write an EIGENSTRAT ind/snp/geno file.