Calculating genetic diversity profiles using self-defined hierarchical structure.

HierDgenind(x, pop_region, pop, q)

Arguments

x

The genetic data, genlind format.

pop_region

The population label in regions

pop

The population labels

q

The order of diversity.

Details

This function calculates the diversity profiles based on Hill numbers. It especially good at deal with high throughout genotyping data.

Value

Diversity profile,Dq0, Dq1, Dq2 in ecosystem, regions, and population per locus, per population.

References

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.

Author

qinxinghu@gmail.com

Examples

#> Warning: package 'adegenet' was built under R version 3.6.3
#> Loading required package: ade4
#> Warning: package 'ade4' was built under R version 3.6.3
#> #> /// adegenet 2.1.3 is loaded //////////// #> #> > overview: '?adegenet' #> > tutorials/doc/questions: 'adegenetWeb()' #> > bug reports/feature requests: adegenetIssues() #>
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)