The GenomeAdmixR package provides many different visualization options, here we will explore a variety of them. First, we simulate a scenario with selection, to obtain somewhat meaningful results.
select_matrix <- matrix(nrow = 1, ncol = 5)
select_matrix[1, ] <- c(0.5, 1, 1 + 0.05, 1 + 0.1, 0)
population <- simulate_admixture(
module = ancestry_module(markers =
c(0.5,
seq(0, 1, length.out = 100))),
pop_size = 1000,
total_runtime = 200,
select_matrix = select_matrix)
## Found a selection matrix, performing simulation including selection
Now, we can first view whether selection on our marker has yielded an increase in frequency:
Indeed, we observe that over time the frequency of the allele under selection (0) increases to fixation due to selection.
How are the alleles scattered across the genome? we can answer that with the function plot_frequencies:
As expected, we observe a huge increase around the location of the marker under selection (at 0.5 Morgan).
If instead, we are interested in the change in frequency of a marker, we can do so using plot_difference_frequencies.
Visualized in another way, plot_start_end plots the frequency distributions at the start and at the end of the simulation:
If, indeed, we are more interested in the progression over time, we can also consult a so called ‘joyplot’, or ‘ridgeplot’:
Lastly, individual chromosomes can be visualized using the standard plotting functions, where both the entire chromosome, and a fraction of the chromosome, can be visualized: