Description Usage Arguments Details Value Examples
Compute Nei's unbiased heterozygosity of a sample of genes.
1 | heterozygosity(tree.with.mutations)
|
tree.with.mutations |
an object generated by the |
Once the sim.tree
and add.mutations
command lines have been executed, heterozygosity
can be used to compute Nei's heterozygosity of the sample
Nei's unbiased heterozygosity of the sample contained in the object ‘history’
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## This is to simulate a coalescent tree using the Hudson's algorithm,
## with 20 sampled lineages. In this example, the current population size
## is 100. It was 1000 before a bottleneck that occurred 50 generations ago
tree <- sim.tree(method = "hudson",sample = 20,current = 100,ancestral = 1000,time = 50)
## This is to generate a history, with a graphical outputs with labels,
## using a mutation rate of 0.001
history <- add.mutations(tree,mu = 0.001,graphics = TRUE, labels = TRUE)
## This is to compute Nei's unbiased heterozygosity for that sample
heterozygosity(history)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.