Description Usage Arguments Value Author(s) References See Also Examples
These functions write DNA sequences to FASTA, PHYLIP, or NEXUS formatted files.
1 2 3 4 5 6 |
x |
a list or matrix of DNA sequences. |
file |
a character string giving the filename; if |
interleave |
an integer, giving the number of bases per line. |
truncate |
truncation of taxon names to the number of characters given as a integer, otherwise (default) taxon names will not be changed. |
append |
logical, if |
strict |
logical, if |
taxblock |
logical, if |
None.
Christoph Heibl
Maddison, D.R., D.L. Swofford, and W.P. Maddison. 1997. NEXUS: an extensible file format for systematic information. Syst. Biol. 46: 590-621.
read.fas
, read.phy
, and read.nex
for reading of DNA sequence files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Example data:
# -----------------------------
data(woodmouse)
woodmouse <- woodmouse[, 1:120]
## Examples for FASTA files
## ------------------------
write.fas(woodmouse, interleave = 60)
## Examples for PHYLIP files
## ------------------------
write.phy(woodmouse, interleave = 40)
## Examples for NEXUS files
## ------------------------
# write nexus file with taxon block
write.nex(woodmouse, taxblock = TRUE)
# write non-interleaved nexus file without taxon block
write.nex(woodmouse, interleave = FALSE)
# Truncation of taxonnames:
# -------------------------
rownames(woodmouse)[15] <- "AVeeeeeeeeeeeeeeeeeryLongName"
write.fas(woodmouse, truncate = 10)
# If truncation leads to identical taxonnames,
# a warning will be issued:
# -------------------------
rownames(woodmouse)[14:15] <- "AVeeeeeeeeeeeeeeeeeryLongName"
write.fas(woodmouse, truncate = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.