Learn R Programming

OutbreakTools (version 0.1-14)

plotggMST: Function to plot a minimum spanning tree of the class 'obkData'

Description

Function to plot a minimum spanning tree for an individual using the mst function from ape and positioning the nodes according to the fruchtermanreingold in sna. The size of the nodes correspond to the number of copies for that particular sequence.

Usage

plotggMST(x,individualID=NULL,locus=NULL)

Arguments

x
An object of the class "obkData"
locus
a character or integer indicating the loci to be used; if NULL, checks will be made to check that only one locus is in the object.
individualID
a character or integer to specify the individual identifier to draw the minimum spanning tree for.

Examples

Run this code
## Not run: 
# ## load data
# data(HorseFlu)
# x <- HorseFlu
# 
# ## plot minimum spanning tree for individual 42
# plotggMST(x,individualID=42)
# 
# ## another example data
# data(ToyOutbreak)
# x <- ToyOutbreak
# 
# ## plot minimum spanning tree for gene1
# plotggMST(x, locus="gene1")
# 
# ## End(Not run)

Run the code above in your browser using DataLab