window_fst: Sliding window Fst calculation

Description Usage Arguments Value

View source: R/Fst.r

Description

Takes a tibble that has the a, b, and c parameters of for Fst calculation (Weir & Cockerham 1984) and calculates Fst over a sliding window. It only worts for a single contig.

Usage

1
window_fst(dat, w_size = 1000, s_size = 300, sorted = FALSE)

Arguments

dat

A tibble with columns 'ref_id', 'ref_pos', and at leat one complete set of c('a', 'b','c') and/or c("n_c", "MSI", "MSP"). The first set is used to calculate traditiona Fst according to Weirr & Cockerham 1984 and the second calculates Fst^pool.

w_size

Window size in bp.

s_size

Step size in bp.

sorted

logical indicating if the sites in dat. are already in sorted ascending order by ref_pos within each ref_id.

Value

A tibble with columns start, end, ref_id, nsites, and Fst and/or Fst_pool columns depending on which estimators were calculated.


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