fst.hudson: Calculate the average fixation index (Fst) between two groups...

Description Usage Arguments Value References See Also Examples

View source: R/pvalue.R View source: R/fst.R

Description

Fixation index (Fst) calculation was implemented using Hudson method as in Bhatia (2013) and Hudson (1992).

Fixation index (Fst) calculation was implemented using Hudson method as in Bhatia (2013) and Hudson (1992).

Usage

1
2
3
fst.hudson(X, idx.p1, idx.p2)

fst.hudson(X, idx.p1, idx.p2)

Arguments

X

A matrix contains the number 0, 1, and 2 representing SNP in additive coding. Rows represent individuals and columns represent SNP.

idx.p1

An integer vector contains the row indices of first population in the matrix X.

idx.p2

An integer vector contains the row indices of second population in the matrix X.

Value

The function returns an average Fst value between 2 specified groups.

The function returns an average Fst value between 2 specified groups.

References

Bhatia, G., Patterson, N., Sankararaman, S., and Price, A.L. (2013). Estimating and interpreting FST: The impact of rare variants. Genome Res. 23, 1514-1521.

Hudson, R.R., Slatkin, M., and Maddison, W.P. (1992). Estimation of levels of gene flow from DNA sequence data. Genetics 132, 583-589.

Bhatia, G., Patterson, N., Sankararaman, S., and Price, A.L. (2013). Estimating and interpreting FST: The impact of rare variants. Genome Res. 23, 1514-1521.

Hudson, R.R., Slatkin, M., and Maddison, W.P. (1992). Estimation of levels of gene flow from DNA sequence data. Genetics 132, 583-589.

See Also

fst.each.snp.hudson

fst.each.snp.hudson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#Load simulated dataset
data(example_SNP)

idx1 <- which(sample_labels == 'pop1')
idx2 <- which(sample_labels == 'pop2')
fst <- fst.hudson(simsnp$snp, idx1, idx2)

#Print out the Fst value between 'pop1' and 'pop2'
print(fst)



#Load simulated dataset
data(example_SNP)

idx1 <- which(sample_labels == 'pop1')
idx2 <- which(sample_labels == 'pop2')
fst <- fst.hudson(simsnp$snp, idx1, idx2)

#Print out the Fst value between 'pop1' and 'pop2'
print(fst)

KRIS documentation built on Jan. 21, 2021, 5:08 p.m.