calculate_fst: Calculate Fixation Index (Fst)

Description Usage Arguments Value

View source: R/Fst.r

Description

Calculates Fst from imported midas data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calculate_fst(
  Dat,
  map,
  method = "Weir-Cockerham",
  support_thres = 1,
  w_size = NULL,
  s_size = NULL,
  sorted = FALSE,
  verbose = TRUE
)

Arguments

Dat

A MIDAS dataset. Imported into R with read_midas_data

map

A tibble with columns sample and Group corresponding to sample names in MIDAS dataset and sample population respectiveley.

method

Weir-Cockerham or Fstpool.

support_thres

calculate_fst uses the depth slot of the MIDAS data as a 'support' value to decide if a site in a given sample will be considered. If it corresponds to depth, this is the minimum coverage at a site at a given sample.

w_size

Window size in bp. If both w_size and s_size are numeric. Fst/Fst^pool values are calculated for a sliding window.

s_size

Window step size in bp. If both w_size and s_size are numeric. Fst/Fst^pool values are calculated for a sliding window.

sorted

Logical indicating if sites are sorted in ascending orderby ref_pos within each ref_id. Only used if sliding windows are calculated

verbose

Logical indicating if progress during site level calculations must be printed.

Value

A list with tibbles fst and w_fst corresponding to site and window level Fst calculations. w_fst is NULL if no window calculations are performed.


surh/HMVAR documentation built on Aug. 18, 2021, 1:21 a.m.