meansnps: Mean diversity within a single population

Description Usage Arguments Examples

View source: R/meansnps.R

Description

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

Usage

1
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

1
2
3
data(withinhost)
meansnps(withinhost$obs.strain, rep(1, 10), withinhost$libr, withinhost$nuc, 
         withinhost$librstrains)

seedy documentation built on May 29, 2017, 10:58 a.m.