Last chance! 50% off unlimited learning
Sale ends in
as.character = "TRUE"
) in lower
case.read.dna(file, format = "interleaved", skip = 0,
nlines = 0, comment.char = "#", seq.names = NULL,
as.character = FALSE, as.matrix = NULL)
format = "fasta"
) of DNA sequences
stored in binary format, or of mode character (if as.character =
"TRUE"
).
Anonymous. IUPAC ambiguity codes.
Felsenstein, J. (1993) Phylip (Phylogeny Inference Package) version
3.5c. Department of Genetics, University of Washington.
read.GenBank
, write.dna
,
DNAbin
, dist.dna
, woodmouse
### a small extract from `data(woddmouse)'
cat("3 40",
"No305 NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT",
"No304 ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT",
"No306 ATTCGAAAAACACACCCACTACTAAAAATTATCAATCACT",
file = "exdna.txt", sep = "")
ex.dna <- read.dna("exdna.txt", format = "sequential")
str(ex.dna)
ex.dna
### the same data in interleaved format...
cat("3 40",
"No305 NTTCGAAAAA CACACCCACT",
"No304 ATTCGAAAAA CACACCCACT",
"No306 ATTCGAAAAA CACACCCACT",
"ACTAAAANTT ATCAGTCACT",
"ACTAAAAATT ATCAACCACT",
"ACTAAAAATT ATCAATCACT",
file = "exdna.txt", sep = "")
ex.dna2 <- read.dna("exdna.txt")
### ... in clustal format...
cat("CLUSTAL (ape) multiple sequence alignment", "",
"No305 NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT",
"No304 ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT",
"No306 ATTCGAAAAACACACCCACTACTAAAAATTATCAATCACT",
"************************** ****** ****",
file = "exdna.txt", sep = "")
ex.dna3 <- read.dna("exdna.txt", format = "clustal")
### ... and in FASTA format
cat("> No305",
"NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT",
"> No304",
"ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT",
"> No306",
"ATTCGAAAAACACACCCACTACTAAAAATTATCAATCACT",
file = "exdna.txt", sep = "")
ex.dna4 <- read.dna("exdna.txt", format = "fasta")
### The first three are the same!
identical(ex.dna, ex.dna2)
identical(ex.dna, ex.dna3)
identical(ex.dna, ex.dna4)
unlink("exdna.txt") # clean-up
Run the code above in your browser using DataLab