haplotype extracts the haplotypes from a set of DNA
sequences. The result can be plotted with the appropriate function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
haplotype(x, ...) ## S3 method for class 'DNAbin' haplotype(x, labels = NULL, ...) ## S3 method for class 'character' haplotype(x, labels = NULL, ...) ## S3 method for class 'numeric' haplotype(x, labels = NULL, ...) ## S3 method for class 'haplotype' plot(x, xlab = "Haplotype", ylab = "Number", ...) ## S3 method for class 'haplotype' print(x, ...) ## S3 method for class 'haplotype' sort(x, decreasing = ifelse(what == "frequencies", TRUE, FALSE), what = "frequencies", ...) ## S3 method for class 'haplotype' x[...]
a set of DNA sequences (as an object of class
a vector of character strings used as names for the rows of the returned object. By default, Roman numerals are given.
labels for the x- and x-axes.
further arguments passed to
a logical value specifying in which order to sort
the haplotypes; by default this depends on the value of
a character specifying on what feature the haplotypes
should be sorted: this must be
sort method sorts the haplotypes in decreasing frequencies
(the default) or in alphabetical order of their labels (if
"labels"). Note that if these labels are Roman numerals (as assigned by
haplotype), their alphabetical order may not be their numerical
one (e.g., IX is alphabetically before VIII).
From pegas 0.7,
haplotype extracts haplotypes taking into
account base ambiguities.
haplotype returns an object of class
"DNAbin") which is an object of class
"DNAbin" with two
"index" identifying the index of each
observation that share the same haplotype, and
the name of the original data.
sort returns an object of the same class respecting its
1 2 3 4 5 6 7 8 9
## 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")[] plot(sort(h)) ## get the frequencies in a named vector: setNames(lengths(attr(h, "index")), labels(h))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.