mutations: Plot Mutations on Networks

View source: R/haplotype.R

mutationsR Documentation

Plot Mutations on Networks

Description

mutations draws annotations about mutations related to the link of a haplotype network.

Usage

mutations(haploNet, link, x, y, data = NULL, style = "table", POS, SEQLEN, ...)

Arguments

haploNet

an object of class "haploNet" which should be plotted beforehand.

link

the link number; can be left missing in which case the list of links in the network is printed and the function exits.

x, y

the coordinates where to draw the annotations; can be left missing: the user is then asked to click where to draw them and the chosen coordinates are printed.

data

the sequence data; can be left missing if the data are attached to the network (for a MJN network output by mjn.)

style

the type annotations. There two possible choices: "table" (default) and "sequence" (can be abbreviated).

POS, SEQLEN

a vector of genomic positions and the sequence length in case data is of class "haplotype.loci".

...

options

Details

The easiest way to use this function is with an output from mjn since the data are attached to the network. In other cases, the sequence data must given to the argument data or attached to the network as an attribute named "data".

Value

none

Author(s)

Emmanuel Paradis

See Also

plot.haploNet, haplotype.loci

Examples

## simple example
x <- as.DNAbin(matrix(c("a", "g"), 2, 1))
rownames(x) <- paste("Ind", 1:2, sep = "_")
nt <- mst(dist.dna(x, "N"))
plot(nt)
mutations(nt, link = 1, x = 2, y = 2, data = x)

example(mjn)
plot(ntz, xlim = c(-5, 20))
mutations(ntz, 6, 10, 0, style = "s")
mutations(ntz, 8, 10, -2, style = "s")

pegas documentation built on May 29, 2024, 2:27 a.m.