成对Phi-st与ade4,mmod和adegenet或类似的包?

时间:2015-09-14 13:52:15

标签: r

对于属于三个不同组的一组不同单倍体群,我有一个每个基因的SNP频率的数据集。我已经进行了AMOVA和置换测试,以测试r中使用ade4包的组之间的区别。但是,我希望在人群之间有成对的Phi-st。我已经搜索了一些替代方案来计算像mmod这样的包中的Phi-st,到目前为止我已经尝试了以下(这只是一个玩具数据集来表示结构,原始文件更大):

library(ade4)
library(mmod)
library(adegenet)

data<-data.frame(A=c("0","0","0","100","25","75"),B=c("0","88","15","0","0","0"),C=c("25","0","0","10","12","90"),X=c("100","80","0","0","0","0"),Y=c("73","20","12","0","0","0"),Z=c("50","100","15","10","0","0")) # Column=Gene

row.names(data)<-.genlab("population",6) # Rows=Populations
# Convert the data frame to genind
data2<-df2genind(data,ploidy=1)
# Calculate Ph-st
Phi_st_Meirmans(data2)

但是我收到以下错误

Error in within_dists/(as.numeric(pop.freqs) * 2) : non-numeric argument to binary operator

我试图找出如何更好地构建我的数据,但我无法做到。

有没有人对如何以更正确的方式做到这一点有任何建议或想法? 提前谢谢!

0 个答案:

没有答案