| Title: | Summarize and Visualize Ancestral Recombination Graphs |
|---|---|
| Description: | Summarize and visualize ancestral recombination graphs. 'ARGHelpR' uses bed files output from ancestral recombination graph (ARG) estimation programs to calculate various statistics that can be used to identify different forms of natural selection. 'ARGHelpR' also allows users to visualize ARGs and provides educational resources on its website. |
| Authors: | Keaka Farleigh [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-9195-121X>), Dylan K. Highland [aut, ctb] (ORCID: <https://orcid.org/0009-0000-2757-9161>), Megan G. Alderman [aut, ctb] (ORCID: <https://orcid.org/0000-0003-2586-9151>), Ellie M. Faber [aut, ctb] (ORCID: <https://orcid.org/0009-0007-3863-5801>), Lukas Westermann Salas [aut, ctb] (ORCID: <https://orcid.org/0009-0008-2716-6699>), Drew R. Schield [aut, cph, ctb] (ORCID: <https://orcid.org/0000-0001-7854-9480>) |
| Maintainer: | Keaka Farleigh <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-12-05 19:56:56 UTC |
| Source: | https://github.com/cran/ARGHelpR |
Visualize ancestral recombination graphs.
argplot( arg, pop1, pop2, col = c("#6C6EA0", "#1A1F16"), scale = NULL, font.size = 1 )argplot( arg, pop1, pop2, col = c("#6C6EA0", "#1A1F16"), scale = NULL, font.size = 1 )
arg |
a newick string of ancestral recombination graph to be visualized. |
pop1 |
a vector of individuals in population one. |
pop2 |
a vector of individuals in population two. |
col |
a vector of two colors. The first color will be used to color the tips of population 1 and the second will color population 2 tips. |
scale |
a vector of two numbers. The first number will set the lower bounds of the scale and the second will set the upper bounds. This is useful when you want to compare two args. |
font.size |
a numeric indicating the size of the tip labels, this is supplied to the cex argument in phytools plotTree function. |
a phylogeny with tips colored according to population.
data(rattlesnake_args) data(rattlesnake_pops) pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] test_plot <- argplot(arg = rattlesnake_args[[1]][1,4], pop1 = pop1$sample, pop2 = pop2$sample, col = c("#71BED6","#EDAF49"))data(rattlesnake_args) data(rattlesnake_pops) pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] test_plot <- argplot(arg = rattlesnake_args[[1]][1,4], pop1 = pop1$sample, pop2 = pop2$sample, col = c("#71BED6","#EDAF49"))
Calculate ancestral recombination graph summary statistics.
argstats(arg.dat, pop1, pop2, pop1.name, pop2.name, n.cores = 1, n.haps = 2)argstats(arg.dat, pop1, pop2, pop1.name, pop2.name, n.cores = 1, n.haps = 2)
arg.dat |
a list where each element is an ancestral recombiation graph represented by a data frame. The data frame columns should be chromosome, start, end, and the phylogeney estimated in ARG analysis. |
pop1 |
a vector of individuals in one population. |
pop2 |
a vector of individuals in the other population. |
pop1.name |
a character string that tells us the name of population 1. |
pop2.name |
a character string that tells us the name of population 2. |
n.cores |
a numeric value indicating the number of cores to run. Default is 1. Anything greater than 1 will run calcualtions in parallel. WARNING increasing this number too high can crash your computer depending on your dataset. |
n.haps |
a numeric value indicating the minimum number of haplotypes to identify a clade. |
A list of elements. Each element is a data frame containing the calculated statistics, the relevant window, and relevant arg. The statistics include the time to the most recent common ancestor between populations/species (tmrca) and estimates of the time to most recent common ancestor within populations/species (tmrcaw). The output also indicates if populations/species are monophyletic and which population/species corresponds to which population.
Keaka Farleigh
data(rattlesnake_args) data(rattlesnake_pops) rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] Test <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2")data(rattlesnake_args) data(rattlesnake_pops) rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] Test <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2")
Identify ancestral recombination graphs under selection that correspond to models of divergence.
identify_argcandidates_divergence( dat, analysis = "all", background = NULL, tmrca.threshold = NULL, pop1.threshold = NULL, pop2.threshold = NULL, tmrca.iqr.low.threshold = NULL, tmrca.iqr.high.threshold = NULL )identify_argcandidates_divergence( dat, analysis = "all", background = NULL, tmrca.threshold = NULL, pop1.threshold = NULL, pop2.threshold = NULL, tmrca.iqr.low.threshold = NULL, tmrca.iqr.high.threshold = NULL )
dat |
a dataframe of ancestral recombination graph statistics calculated using the argstats function. |
analysis |
a character vector indicating the types of args you want to identify. Options are "all" for all types, "RI", "DS", "RS", "RIDS". |
background |
a dataframe of ancestral recombination graph statistics calculated using the argstats function. If supplied this will be used to define thresholds and the dat argument will be treated as the test set. |
tmrca.threshold |
a numeric value to customize the tmrca threshold used to identify ARGs associated with reproductive isolation. |
pop1.threshold |
a numeric value to customize the pop1 tmrcaw threshold used to identify ARGs associated with within-population selection and recurrent selection. |
pop2.threshold |
a numeric value to customize the pop2 tmrcaw threshold used to identify ARGs associated with within-population selection and recurrent selection. |
tmrca.iqr.low.threshold |
a numeric value to customize the lower tmrca threshold used to identify ARGs associated with within-population selection and recurrent selection. |
tmrca.iqr.high.threshold |
a numeric value to customize the upper tmrca threshold used to identify ARGs associated with within-population selection and recurrent selection. |
a list containing ARGs that were identified as candidates
data("rattlesnake_args") data("rattlesnake_pops") rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] stat_res <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2") stat_df <- do.call("rbind", stat_res) Test <- identify_argcandidates_divergence(dat = stat_df, analysis = "all")data("rattlesnake_args") data("rattlesnake_pops") rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] stat_res <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2") stat_df <- do.call("rbind", stat_res) Test <- identify_argcandidates_divergence(dat = stat_df, analysis = "all")
A list where each element is a data frame representing a single ancestral recombination graph.
data(rattlesnake_args)data(rattlesnake_args)
A list with data frames with four columns:
The chromsome information for each ARG.
The start position of each ARG.
The end position of each ARG.
The ARG for the interval.
...
Farleigh, K., Highland, D. K., Alderman, M. G., Francioli, Y., Hirst, S. R., Faber, E. M., ... & Schield, D. R. (2026). Evolution of genome-wide barriers to gene flow during complex speciation in rattlesnakes. Proceedings of the National Academy of Sciences, 123(21), e2609058123.
data(rattlesnake_args) data(rattlesnake_pops) rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] Test <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2")data(rattlesnake_args) data(rattlesnake_pops) rattlesnake_test <- rattlesnake_args[1:5] pop2 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop2"),] pop1 <- rattlesnake_pops[which(rattlesnake_pops$species == "pop1"),] Test <- argstats(arg.dat = rattlesnake_test, pop1 = pop1$sample, pop2 = pop2$sample, pop1.name = "pop1", pop2.name = "pop2")
Data frame containing 2 columns and 30 rows
data(rattlesnake_pops)data(rattlesnake_pops)
A data frame with 2 columns and 30 rows:
All haplotypes in the data
Population assignment
...
Farleigh, K., Highland, D. K., Alderman, M. G., Francioli, Y., Hirst, S. R., Faber, E. M., ... & Schield, D. R. (2026). Evolution of genome-wide barriers to gene flow during complex speciation in rattlesnakes. Proceedings of the National Academy of Sciences, 123(21), e2609058123.
data(rattlesnake_pops) Test <- rattlesnake_pops[,1]data(rattlesnake_pops) Test <- rattlesnake_pops[,1]