3 \title{Write DNA Sequences in a File}
5 write.dna(x, file, format = "interleaved", append = FALSE,
6 nbcol = 6, colsep = " ", colw = 10, indent = NULL,
10 \item{x}{a list or a matrix of DNA sequences.}
11 \item{file}{a file name specified by either a variable of mode character,
12 or a double-quoted string.}
13 \item{format}{a character string specifying the format of the DNA
14 sequences. Three choices are possible: \code{"interleaved"},
15 \code{"sequential"}, or \code{"fasta"}, or any unambiguous
16 abbreviation of these.}
17 \item{append}{a logical, if \code{TRUE} the data are appended to the
18 file without erasing the data possibly existing in the file,
19 otherwise the file (if it exists) is overwritten (\code{FALSE} the
21 \item{nbcol}{a numeric specifying the number of columns per row (6 by
22 default); may be negative implying that the nucleotides are printed
24 \item{colsep}{a character used to separate the columns (a single
26 \item{colw}{a numeric specifying the number of nucleotides per column
28 \item{indent}{a numeric or a character specifying how the blocks of
29 nucleotides are indented (see details).}
30 \item{blocksep}{a numeric specifying the number of lines between the
31 blocks of nucleotides (this has an effect only if `format =
35 This function writes in a file a list of DNA sequences in sequential,
36 interleaved, or FASTA format.
39 Three formats are supported in the present function: see the help page
40 of \code{\link{read.dna}} and the references below for a description.
42 If the sequences have no names, then they are given "1", "2", ... as
45 With the interleaved and sequential formats, the sequences must be all
46 of the same length. The names of the sequences are not truncated.
48 The argument \code{indent} specifies how the rows of nucleotides are
49 indented. In the interleaved and sequential formats, the rows with
50 the taxon names are never indented; the subsequent rows are indented
51 with 10 spaces by default (i.e., if \code{indent = NULL}). In the FASTA
52 format, the rows are not indented by default. This default behaviour
53 can be modified by specifying a value to \code{indent}: the rows are then
54 indented with ``indent'' (if it is a character) or `indent' spaces (if
55 it is a numeric). For example, specifying \code{indent = " "} or
56 \code{indent = 3} will have the same effect (use \code{indent = "\\t"}
59 The different options are intended to give flexibility in formatting
60 the sequences. For instance, if the sequences are very long it may be
61 judicious to remove all the spaces beween columns (colsep = ""), in
62 the margins (indent = 0), and between the blocks (blocksep = 0) to
63 produce a smaller file.
66 Specifying a negative value for `nbcol' (meaning that the nucleotides
67 are printed on a single line) gives the same output for the
68 interleaved and sequential formats.
70 The names of the sequences may be truncated with the function
71 \code{\link{makeLabel}}. In particular, Clustal is limited to 30
72 characters, and PHYML seems limited to 99 characters.
75 None (invisible `NULL').
77 \author{Emmanuel Paradis}
79 Anonymous. FASTA format description.
80 \url{http://www.ncbi.nlm.nih.gov/BLAST/fasta.html}
82 Anonymous. IUPAC ambiguity codes.
83 \url{http://www.ncbi.nlm.nih.gov/SNP/iupac.html}
85 Felsenstein, J. (1993) Phylip (Phylogeny Inference Package) version
86 3.5c. Department of Genetics, University of Washington.
87 \url{http://evolution.genetics.washington.edu/phylip/phylip.html}
90 \code{\link{read.dna}}, \code{\link{read.GenBank}},
91 \code{\link{makeLabel}}