haplotype: Haplotype Extraction and Frequencies

Description Usage Arguments Value Author(s) See Also Examples

Description

haplotype extracts the haplotypes from a set of DNA sequences. The result can be plotted with the appropriate function.

Usage

1
2
3
4
5
haplotype(x, labels = NULL)
## S3 method for class 'haplotype'
plot(x, ...)
## S3 method for class 'haplotype'
print(x, ...)

Arguments

x

a set of DNA sequences (as an object of class "DNAbin", or an object of class "haplotype".

labels

a vector of character strings used as names for the rows of the returned object. By default, Roman numerals are given.

...

further arguments passed to barplot (unused in print).

Value

haplotype returns an object of class c("haplotype", "DNAbin") which is an object of class "DNAbin" with two additional attributes: "index" identifying the index of each observation that share the same haplotype, and "from" giving the name of the original data.

Author(s)

Emmanuel Paradis

See Also

haploNet, DNAbin for manipulation of DNA sequences in R.

Examples

1
2
3
4
5
6
## generate some artificial data from 'woodmouse':
data(woodmouse)
x <- woodmouse[sample(15, size = 110, replace = TRUE), ]
(h <- haplotype(x))
## the indices of the individuals belonging to the 1st haplotype:
attr(h, "index")[[1]]

dwinter/Pegas documentation built on May 15, 2019, 6:21 p.m.