4 \alias{as.DNAbin.character}
6 \alias{as.DNAbin.alignment}
7 \alias{as.character.DNAbin}
8 \title{Conversion Among DNA Sequence Internal Formats}
10 These functions transform a set of DNA sequences among various
17 \method{as.DNAbin}{character}(x, ...)
19 \method{as.DNAbin}{list}(x, ...)
21 \method{as.DNAbin}{alignment}(x, ...)
23 \method{as.character}{DNAbin}(x, ...)
26 \item{x}{a matrix or a list containing the DNA sequences, or an object
27 of class \code{"alignment"}.}
28 \item{...}{further arguments to be passed to or from other methods.}
31 For \code{as.alignment}, the sequences given as argument should be
32 stored as matrices or lists of single-character strings (the format
33 used in \pkg{ape} before version 1.10). The returned object is in the
34 format used in the package \pkg{seqinr} to store aligned sequences.
36 \code{as.DNAbin} is a generic function with methods so that it works
37 with sequences stored into vectors, matrices, or lists.
39 \code{as.character} is a generic function: the present method
40 converts objects of class \code{"DNAbin"} into the format used
41 before \pkg{ape} 1.10 (matrix of single characters, or list of vectors
42 of single characters). This function must be used first to convert
43 objects of class \code{"DNAbin"} into the class \code{"alignment"}.
46 an object of class \code{"alignment"} in the case of
47 \code{"as.alignment"}; an object of class \code{"DNAbin"} in the case
48 of \code{"as.DNAbin"}; a matrix of mode character or a list containing
49 vectors of mode character in the case of \code{"as.character"}.
51 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
53 \code{\link{DNAbin}}, \code{\link{read.dna}},
54 \code{\link{read.GenBank}}, \code{\link{write.dna}}
58 x <- as.character(woodmouse)
61 identical(as.DNAbin(x), woodmouse)