ape (version 3.0-6)

write.dna: Write DNA Sequences in a File

Description

This function writes in a file a list of DNA sequences in sequential, interleaved, or FASTA format.

Usage

write.dna(x, file, format = "interleaved", append = FALSE,
          nbcol = 6, colsep = " ", colw = 10, indent = NULL,
          blocksep = 1)

Arguments

Value

None (invisible `NULL').

Details

Three formats are supported in the present function: see the help page of read.dna and the references below for a description.

If the sequences have no names, then they are given "1", "2", ... as names in the file.

With the interleaved and sequential formats, the sequences must be all of the same length. The names of the sequences are not truncated.

The argument indent specifies how the rows of nucleotides are indented. In the interleaved and sequential formats, the rows with the taxon names are never indented; the subsequent rows are indented with 10 spaces by default (i.e., if indent = NULL). In the FASTA format, the rows are not indented by default. This default behaviour can be modified by specifying a value to indent: the rows are then indented with ``indent'' (if it is a character) or `indent' spaces (if it is a numeric). For example, specifying indent = "" or indent = 3 will have the same effect (use indent = "\t" for a tabulation).

The different options are intended to give flexibility in formatting the sequences. For instance, if the sequences are very long it may be judicious to remove all the spaces beween columns (colsep = ""), in the margins (indent = 0), and between the blocks (blocksep = 0) to produce a smaller file.

References

Anonymous. FASTA format description. http://www.ncbi.nlm.nih.gov/BLAST/fasta.html

Anonymous. IUPAC ambiguity codes. http://www.ncbi.nlm.nih.gov/SNP/iupac.html

Felsenstein, J. (1993) Phylip (Phylogeny Inference Package) version 3.5c. Department of Genetics, University of Washington. http://evolution.genetics.washington.edu/phylip/phylip.html

See Also

read.dna, read.GenBank, makeLabel