Learn R Programming

seedy (version 1.3)

meansnps: Mean diversity within a single population

Description

Calculates the expected pairwise genetic distance (number of SNPs) between two randomly sampled genomes in a population.

Usage

meansnps(strain.log, freq.log, libr, nuc, key)

Arguments

strain.log
Vector of unique genotype IDs in population
freq.log
Vector of counts of genotypes in population, corresponding to strain.log.
libr
Library object from simulation functions. A list in which each entry represents a unique genotype, and is a vector of mutated nucleotide positions relative to the reference seqeunce.
nuc
Nucleotide database from simulation functions. A list (corresponding to libr) in which each entry represents a unique genotype, and is a vector of mutated nucleotides relative to the reference sequence.
key
Vector of genotype IDs corresponding to the libr and nuc objects.

Examples

Run this code
data(withinhost)
meansnps(withinhost$obs.strain, rep(1, 10), withinhost$libr, withinhost$nuc, 
         withinhost$librstrains)

Run the code above in your browser using DataLab