Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Fst

Calculate fixation indices


Description

This function calculates the fixation index Fst for each SNP, together with its weight in the overall estimate (as used by the Internation HapMap Consortium).

Usage

Fst(snps, group, pairwise=FALSE)

Arguments

snps

an object of class SnpMatrix or XSnpMatrix containing the SNP data

group

a factor (or object than can be coerced into a factor), of length equal to the number of rows of snps, giving the grouping or rows for which the Fst is to be calculated

pairwise

if TRUE, the within-group variances are weighted according to the number of possible within-group pairwise comparisons of chromosomes. If FALSE, the default value, weights are simply the number of chromosomes in each group.

Details

See vignette.

Value

A list:

Fst

Fst values for each SNP

weight

The weights for combining these into a single index

Note

Uncertain genotypes are treated as missing

Author(s)

David Clayton dc208@cam.ac.uk

Examples

## Analysis of some HapMap data

data(for.exercise)
f <- Fst(snps.10, subject.support$stratum)
weighted.mean(f$Fst, f$weight)

snpStats

SnpMatrix and XSnpMatrix classes and methods

v1.40.0
GPL-3
Authors
David Clayton <dc208@cam.ac.uk>
Initial release
2019-10-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.