micropan (version 1.1.2)

rarefaction: Rarefaction curves for a pan-genome

Description

Computes rarefaction curves for a number of random permutations of genomes.

Usage

rarefaction(pan.matrix, n.perm = 1)

Arguments

pan.matrix
A Panmat object, see panMatrix for details.
n.perm
The number of random genome orderings to use. If n.perm=1 the fixed order of the genomes in pan.matrix is used.

Value

This function returns a Rarefac object, which is a small extension to a matrix. The generic functions plot.Rarefac and summary.Rarefac are available for such objects.

Details

A rarefaction curve is simply the cumulative number of unique gene clusters we observe as more and more genomes are being considered. The shape of this curve will depend on the order of the genomes. This function will typically compute rarefaction curves for a number of (n.perm) orderings. By using a large number of permutations, and then averaging over the results, the effect of any particular ordering is smoothed away.

The averaged curve illustrates how many new gene clusters we observe for each new genome. If this levels out and becomes flat, it means we expect few, if any, new gene clusters by sequencing more genomes. The function heaps can be used to estimate population openness based on this principle.

See Also

heaps, panMatrix, plot.Rarefac, summary.Rarefac.

Examples

Run this code
# Loading two Panmat objects in the micropan package 
data(list=c("Mpneumoniae.blast.panmat","Mpneumoniae.domain.panmat"),package="micropan")

# Rarefaction based on a BLAST clustering Panmat object
rarefac.blast <- rarefaction(Mpneumoniae.blast.panmat,n.perm=100)
plot(rarefac.blast)

# Rarefaction based on domain sequence clustering Panmat object
rarefac.domains <- rarefaction(Mpneumoniae.domain.panmat,n.perm=1000)
summary(rarefac.domains)

Run the code above in your browser using DataLab