site_fst: Fixation Index (Fst) for one site

Description Usage Arguments Details Value

View source: R/Fst.r

Description

Takes allele frequency data from one site only and calculates Wright's fixation index (Fst).

Usage

1
2
3
4
5
6
7
8
site_fst(
  freq,
  support,
  info,
  map,
  support_thres = 1,
  method = "Weir-Cockerham"
)

Arguments

freq

A 1 x (n+1) tibble. One of the columns must correspond to 'site_id', and the rest of the columns correspond to one sample each. Entries under each sample correspond to allele frequencies.

support

A 1 x (n+1) tibble. Columns must match columns in freq. Values must be numeric and indicate support of each allele frequencuy

info

A tiblle with one row. One column must correspond to 'site_id'. The rest of the columns contain information about the site

map

A tibble with columns 'sample' (corresponding to column names) in freq and support, and 'Group' corresponding to the populations used for Fst calculations.

support_thres

Minimum value in support tibble to keep a sample for this site

method

The method to calculate Fst. Currently only the 'Weir-Cockerham' method from 1984, and the 'Fstpool' methods are implemented.

Details

It works only for haploid individuals (e.g proportion of heterozygous is 0).

Value

A tibble


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