gd: Genetic distance matrix

Description Usage Arguments Details Value Examples

View source: R/gd.R

Description

Given a set of genomic samples, returns a pairwise geentic distance matrix

Usage

1
gd(samp, libr, nuc, key)

Arguments

samp

Vector of sample IDs.

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 sample IDs in the order they appear in the libr and nuc objects.

Details

Each element of samp represents one row and column in the genetic distance matrix.

Value

Returns a symmetric genetic distance matrix with rows and columns corresponding to the samp vector.

Examples

1
2
data(withinhost)
gd(withinhost$obs.strain, withinhost$libr, withinhost$nuc, withinhost$librstrains)

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