library(dartR)
t1 <-
platypus.glt1 <- gl.filter.callrate(t1,threshold = 1)
popNames(t1)
# [1] "SEVERN_ABOVE" "SEVERN_BELOW" "TENTERFIELD"
# testing whether FST between "TENTERFIELD" and "SEVERN_BELOW" is significantly
# different from FST "TENTERFIELD" and "SEVERN_ABOVE"
t2 <- gl.keep.pop(t1,pop.list = c( "TENTERFIELD","SEVERN_BELOW") )
t3 <- gl.t2 <- gl.keep.pop(t1,pop.list = c( "TENTERFIELD","SEVERN_ABOVE") )
# calculating stats
res_t2_tmp <- utils.basic.stats(t2)
res_t3_tmp <- utils.basic.stats(t3)
res_t2 <- res_t2_tmp$perloc$Fstp
res_t3 <- res_t3_tmp$perloc$Fstp
# Identify that the data conforms to a normal distribution using a
# Shapiro–Wilk test of normality
plot(density(res_t2,na.rm = TRUE))
res_shapiro_t2 <- shapiro.test(res_t2)
plot(density(res_t3,na.rm = TRUE))
res_shapiro_t3 <- shapiro.test(res_t3)
# If data is NOT normally distributed use Mann–Whitney U test
res_wilc <- wilcox.test(res_t2,res_t3)
# If data is normally distributed use Student's t-Test
res_ttest <- t.test(res_t2,res_t3)
# testing whether FST is different from 0
res_fst <- gl.fst.pop(t1,nboots = 100)
res_fst$Pvalues