HierDgenind.Rd
Calculating genetic diversity profiles using self-defined hierarchical structure.
HierDgenind(x, pop_region, pop, q)
x | The genetic data, genlind format. |
---|---|
pop_region | The population label in regions |
pop | The population labels |
q | The order of diversity. |
This function calculates the diversity profiles based on Hill numbers. It especially good at deal with high throughout genotyping data.
Diversity profile,Dq0, Dq1, Dq2 in ecosystem, regions, and population per locus, per population.
Jombart, T. (2008). adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24(11), 1403-1405.
Qin, X. (2019). HierDpart: partitioning hierarchical diversity and differentiation across metrics and scales, from genes to ecosystems. R package version 0.5. 0 https://cran. r-project. org/package= HierDpart.
qinxinghu@gmail.com
#> Warning: package 'adegenet' was built under R version 3.6.3#>#> Warning: package 'ade4' was built under R version 3.6.3#> #>#> #> #> #> #>data(eHGDP) # example genepop file ### formating data, restructing the hierarchical data structure levels(eHGDP$pop)=eHGDP$other$popInfo$Population ###struct a table with individual region/pop labels popstr= eHGDP$other$popInfo[match(eHGDP$pop,eHGDP$other$popInfo$Population),] popstr$Population=factor(popstr$Population,levels=unique(popstr$Population)) popstr$Region=factor(popstr$Region,levels=unique(popstr$Region)) #library(poppr) #eHGDP1=missingno(eHGDP, type = "mean", quiet = FALSE, freq = FALSE) eHGDP$tab=(tab(eHGDP, freq = FALSE, NA.method = "mean")) HiereHGDPq0=HierDgenind(eHGDP,q=0,pop_region = popstr$Region,pop = popstr$Population) HiereHGDPq1=HierDgenind(eHGDP,q=1,pop_region = popstr$Region,pop = popstr$Population) HiereHGDPq2=HierDgenind(eHGDP,q=2,pop_region = popstr$Region,pop = popstr$Population)