parameter_barge: Generate and transfer parameters, quantities, and objects...

Description Usage Arguments

View source: R/parameter_barge.R

Description

Generate and transfer parameters, quantities, and objects used for fitting downstream convergent adaptation models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
parameter_barge(
  neutral_freqs,
  selected_freqs,
  selected_pops,
  positions,
  n_sites = NULL,
  sel_sites = NULL,
  sample_sizes,
  num_bins,
  sets = NULL,
  modes = NULL,
  sels,
  migs,
  times,
  gs,
  sources,
  Ne,
  rec,
  locus_name = "locus",
  cholesky = TRUE
)

Arguments

neutral_freqs

Matrix of allele frequencies at putatively neutral sites with dimensions, number of populations x number of sites.

selected_freqs

Matrix of allele frequencies at putatively selected sites with dimensions, number of populations x number of sites.

selected_pops

Vector of indices for populations that experienced selection.

positions

Vector of genomic positions for the selected region.

n_sites

Integer for the number of sites to propose as the selected site. Sites are uniformly placed along positions using seq(min(positions), max(positions), length.out = n_sites). Must be less than or equal to length(positions). Cannot be used with sel_sites.

sel_sites

Optional vector of sites to propose as selected site. Useful if particular loci are suspected to be under selection. Cannot be used with n_sites.

sample_sizes

Vector of sample sizes of length number of populations. (i.e. twice the number of diploid individuals sampled in each population).

num_bins

The number of bins in which to bin alleles a given distance from the proposed selected sites.

sets

A list of population indices, where each element in the list contains a vector of populations with a given mode of convergence. For example, if populations 2 and 6 share a mode and population 3 has another, sets = list(c(2,6), 3). Required for modeling multiple modes. Only required for fitting models with mixed modes. Must be used in conjunction with the "modes".

modes

Character vector of length sets defining mode for each set of selected populations ("independent", "standing", and/or "migration"). Only required for fitting models with mixed modes. More details about the modes is available on help page for mode_cle

sels

Vector of proposed selection coefficients.

migs

Vector of proposed migration rates (proportion of individuals of migrat origin each generation). Cannot be 0.

times

Vector of proposed times in generations the variant is standing in populations before selection occurs and prior to migration from source population.

gs

Vector of proposed frequencies of the standing variant.

sources

Vector of population indices to propose as the source population of the beneficial allele. Used for both the migration and standing variant with source models. Note: the source must be one of the populations contained in selPops.

Ne

Effective population size (assumed equal for all populations).

rec

Per base recombination rate for the putatively selected region.

locus_name

String to name the locus. Helpful if multiple loci will be combined in subsequent analyses. Defaults to "locus".

cholesky

Logical to use cholesky factorization of covariance matrix. Used for both inverse and determinant. Faster, but not guaranteed to work for all data sets. TRUE by default. if FALSE, ginv from MASS is used.


silastittes/rdmc documentation built on Jan. 31, 2021, 1:49 a.m.