Jost's D and G'st

91 views
Skip to first unread message

Nadia Faure

unread,
Oct 16, 2023, 5:41:48 AM10/16/23
to dartR
Hello,
Is there a way to calculate Jost's D and G'st pairwise values between populations and their significance?
For Fst, the gl.fst.pop() function is very handy, thank you!! But there don't seem to be any equivalent functions for G'st and Jost's D, right?

I've managed to calculate these two metrics with the mmod package:
pairwise_Gst <- pairwise_Gst_Hedrick(genind)
pairwise_JostD <- pairwise_D(genind)

But I can't get the pvalues with a bootstrap of 10000
Do you have any ideas?

Thanks for your help,
Nadia

Jose Luis Mijangos

unread,
Oct 16, 2023, 7:28:54 PM10/16/23
to dartR
Hi Nadia,

You can try:

> install.packages("dartR.base")
> library(dartR.base)
> res <- gl.report.fstat(possums.gl)

Check the function documentation to learn about the bootstrapping options. 

Cheers,
Luis 

Nadia Faure

unread,
Oct 17, 2023, 3:34:11 AM10/17/23
to dartR
Hi Luis,
Thanks a lot for this nice function! Is there a way to get a matrix of pvalues rather than CI?
Cheers,
Nadia

Jose Luis Mijangos

unread,
Oct 17, 2023, 8:04:41 PM10/17/23
to dartR
Hi Nadia,

See code below:

library(dartR)
t1 <- platypus.gl
t1 <- 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

Cheers,
Luis 

Reply all
Reply to author
Forward
0 new messages