Number of effective allels

245 views
Skip to first unread message

ahawl...@gmail.com

unread,
Sep 23, 2022, 7:30:50 AM9/23/22
to dartR
Hello All,

First of all I would like to apologize, for asking a question, ,that is loosely related to dartR package. I am working with a  big set of DArT SNP data and  was asked to calculate Na (number of alleles) and Ne (number of effective alleles). Most of the statistics I've done using dartR, but it seems like this function is not available. All papers that I could find either relate to the SSR markers or use the GenAlex software, which is not suitable in my case, due to a large data set (to big for two-column format in Excel). 
If anyone could recommend a package or a function that I could use? 
Would greatly appreciate your help.
Regards

Anna

Jose Luis Mijangos

unread,
Sep 27, 2022, 7:58:18 PM9/27/22
to dartR
Hi Anna,

Sorry for the late reply.

You can calculate the effective number of alleles using the dartR function gl.report.diversity(), as shown in the code below. This function is based on the paper of Bill Sherwin: 
Sherwin, William B., et al. "Information theory broadens the spectrum of molecular ecology and evolution." Trends in ecology & evolution 32.12 (2017): 948-963.

The effective number of alleles is very sensitive to rare alleles and unequal sample sizes, so it can be biased if you don't have a large sample size. The best way to deal with this is calculating allelic richness using the rarefaction method as implemented in the package Hierfstat, as shown in the code below. If you want to know more about how allelic richness is calculated, see:
El Mousadik, A., and R. J. Petit. "High level of genetic differentiation for allelic richness among populations of the argan tree [Argania spinosa (L.) Skeels] endemic to Morocco." Theoretical and applied genetics 92.7 (1996): 832-839.


library(dartR)
test <- platypus.gl
res <- gl.report.diversity(test)
# this is the effective number of alleles
res_2 <- res$zero_D_alpha
# printing results
res_2

library(hierfstat)
test_2 <- platypus.gl
# filtering loci with all missing data
test_2 <- gl.filter.allna(test_2)
#converting to genind
genind_2 <- gl2gi(test_2)
#converting to hierfstat
hierfstat <- genind2hierfstat(genind_2)
# calculating allelic richness
res_3 <- allelic.richness(hierfstat)
# calculating mean by column
res_4 <- colMeans(res_3$Ar,na.rm = TRUE)
#printing results
res_4

Cheers,
Luis

ahawl...@gmail.com

unread,
Oct 6, 2022, 4:43:53 AM10/6/22
to dartR
Dear Luis,

Thank You so Much! 

Cheers,
Anna

Alexandra McCarty

unread,
Oct 25, 2024, 9:33:20 AMOct 25
to dartR
This is very helpful - thank you!

Going back to Anna's original comment, are you able to estimate effective population size in dartR or with dartR output format? I've come across the program NeEstimator v2.01, but I am having a very difficult time getting it to work on my computer. Is there an R package?

Thank you!
Lexy

Bernd.Gruber

unread,
Oct 25, 2024, 5:16:56 PMOct 25
to da...@googlegroups.com
gl.LdNe

Is a wrapper around neestimator 2

Check the help pages on how to run

Cheers Bernd
---------


On 26 Oct 2024, at 00:33, Alexandra McCarty <ajmcc...@smcm.edu> wrote:

This is very helpful - thank you!
--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/883667b1-2c49-4415-b815-60a185a040e3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages