8 \alias{as.matrix.DNAbin}
9 \title{Manipulate DNA Sequences in Bit-Level Format}
11 These functions help to manipulate DNA sequences coded in the
12 bit-level coding scheme.
15 \method{print}{DNAbin}(x, \dots)
16 \method{summary}{DNAbin}(object, printlen = 6, digits = 3, \dots)
17 \method{rbind}{DNAbin}(\dots)
18 \method{cbind}{DNAbin}(\dots, check.names = TRUE)
19 \method{[}{DNAbin}(x, i, j, drop = TRUE)
20 \method{as.matrix}{DNAbin}(x, \dots)
23 \item{x, object}{an object of class \code{"DNAbin"}.}
24 \item{\dots}{either further arguments to be passed to or from other
25 methods in the case of \code{print}, \code{summary}, and
26 \code{as.matrix}, or a series of objects of class \code{"DNAbin"} in
27 the case of \code{rbind} and \code{cbind}.}
28 \item{printlen}{the number of labels to print (6 by default).}
29 \item{digits}{the number of digits to print (3 by default).}
30 \item{check.names}{a logical specifying whether to check the rownames
31 before binding the columns (see details).}
32 \item{i, j}{indices of the rows and/or columns to select or to drop.
33 They may be numeric, logical, or character (in the same way than for
35 \item{drop}{logical; if \code{TRUE} (the default), the returned object
36 is of the lowest possible dimension.}
39 These are all `methods' of generic functions which are here applied to
40 DNA sequences stored as objects of class \code{"DNAbin"}. They are
41 used in the same way than the standard R functions to manipulate
42 vectors, matrices, and lists. Additionally, the operators \code{[[}
43 and \code{$} may be used to extract a vector from a list.
45 These functions are provided to manipulate easily DNA sequences coded
46 with the bit-level coding scheme. The latter allows much faster
47 comparisons of sequences, as well as storing them in less memory
48 compared to the format used before \pkg{ape} 1.10.
50 For \code{cbind}, if \code{"check.names = TRUE"}, the rownames of each
51 matrix are checked, and the rows are reordered if necessary. If the
52 rownames differ among matrices, an error occurs. If
53 \code{"check.names = FALSE"}, the matrices are simply binded and the
54 rownames of the first matrix are used.
56 \code{as.matrix} may be used to convert DNA sequences (of the same
57 length) stored in a list into a matrix while keeping the names and the
61 an object of class \code{"DNAbin"} in the case of \code{rbind},
62 \code{cbind}, and \code{[}.
65 Paradis, E. (2007) A Bit-Level Coding Scheme for Nucleotides.
66 \url{http://pbil.univ-lyon1.fr/R/ape/misc/BitLevelCodingScheme_20April2007.pdf}
68 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
70 \code{\link{as.DNAbin}}, \code{\link{read.dna}},
71 \code{\link{read.GenBank}}, \code{\link{write.dna}}
73 The corresponding generic functions are documented in the package
80 summary(woodmouse, 15, 6)
81 summary(woodmouse[1:5, 1:300], 15, 6)
82 ### Just to show how distances could be influenced by sampling:
83 dist.dna(woodmouse[1:2, ])
84 dist.dna(woodmouse[1:3, ])