Learn R Programming

PopGenome (version 1.2.6)

diversity.stats-methods: Diversities

Description

A generic function to calculate some nucleotide & haplotype diversities.

Usage

## S3 method for class 'GENOME':
diversity.stats(object,new.populations=FALSE,subsites=FALSE,pi=FALSE)

Arguments

object
An object of class "GENOME"
new.populations
list of populations. default=FALSE
subsites
"transitions": SNPs which are transitions. "transversions": SNPs which are transversions. "syn": synonymous sites. "nonsyn": nonsynonymous sites. "exon": SNPs in exon regions. "i
pi
Nei's pi calculation

Value

  • Returned value is an modified object of class "GENOME" --------------------------------------------------------- Following slots will be modified in the "GENOME" object --------------------------------------------------------- rlll{ Slot Reference Description 1. nuc.diversity.within [1] Nucleotide diversity (within the population) 2. Pi [2] Diversity from Nei (within the population) 3. hap.diversity.within [1] Haplotype diversity (within the population) }

Details

The nucleotide diversity have to be devided by GENOME.class@n.sites

References

[1] Hudson, R. R., M. Slatkin, and W.P. Maddison (1992). Estimating of levels of gene flow from DNA sequence data. Gentics 13(2),583-589 [2] Nei, M. (1987). Molecular Evolutionary Genetics. Columbia Univ. Press, New York.

Examples

Run this code
# GENOME.class <- readData("\home\Alignments")
# GENOME.class
# GENOME.class <- diversity.stats(GENOME.class)
# GENOME.class <- diversity.stats(GENOME.class,list(1:4,5:10))
# GENOME.class <- diversity.stats(GENOME.class,
# list(c("seq1","seq5","seq3"),c("seq2","seq8")))
# show the result:
# GENOME.class@nuc.diversity.within

Run the code above in your browser using DataLab