joyplot_frequencies: make a joy plot of the distribution of allele frequencies...

Description Usage Arguments Value Author(s) Examples

Description

This function plots the distribution of allele frequencies within a region over time, making use of a 'joyplot'

Usage

1
joyplot_frequencies(frequencies, time_points, picked_ancestor)

Arguments

frequencies

A tibble containing four columns: time, location, ancestor, frequency. Typically one of the items returned by create_population_selection or select_population when the user specifies track_frequency.

time_points

A sequence of time points for which the user wants to create the joyplot

picked_ancestor

Default is "ALL", where different colors indicate different ancestors. Alternatively, for clarity, the user can specify a specific ancestral allele, and only that allele is plotted

Value

a ggplot2 object

Author(s)

Thijs Janzen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  s <- 0.01
  select_matrix <- matrix(nrow = 1, ncol = 5)
  select_matrix[1, ] <- c(0.25, 1.0, 1 + 0.5 * s, 1 + s, 0)

  markers <- seq(from = 0.2, to = 0.3, length.out = 100)

  selected_pop <- create_population_selection(pop_size = 1000,
                                              number_of_founders = 10,
                                              total_runtime = 11,
                                              morgan = 1,
                                              select_matrix,
                                              seed = 1234)
  joyplot_frequencies(selected_pop$frequencies,
                    0:11, picked_ancestor = "ALL")

thijsjanzen/isoSIM documentation built on May 29, 2019, 10:39 a.m.