This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Computing Fst For Snp Data In 0,1,2 Format?

Hi,

Does anyone know of software that computes Fst values from SNP data encoded as 0, 1, 2, i.e., 0==AA, 1==Aa, 2==aa?

Thanks,
D.

snps fst

I know that the Pegas package calculates Fst. With some minor file formatting you could use it.

I would also suggest trying to write your own. Fst is pretty easy to implement and worth it.

1 answer

It looks like the basic.stats function from the hierfstat R package will calculate Fst.

You may need to convert the integers to factors using the factors function. eg:

> data = c(1,2,2,0,1,2,0,0,1,2,0,0,1)
> fdata = factor(data)
> fdata
 [1] 1 2 2 0 1 2 0 0 1 2 0 0 1
Levels: 0 1 2

I'm trying to achieve the same and followed your recommendations but it seems like hierfstat only allows 1 and 2 values as input and they are integers not factors in the example given.

Log in to answer this question.