
Last chance! 50% off unlimited learning
Sale ends in
Format phylip
and Format fasta
.
These functions only read files in basic syntax, and
return an object in Class seq.data
.read.fasta(filename, byrow = TRUE, code.type = .code.type[1], aligned = TRUE,
sep = "")
read.fasta.format(filename, byrow = TRUE, aligned = TRUE, sep = "")read.phylip(filename, byrow = TRUE, code.type = .code.type[1], sep = "")
read.phylip.format(filename, byrow = TRUE, sep = "")
Class seq.data
.read.fasta
returns a list storing data.
read.phylip
is only for aligned data and returns a matrix. read.fasta.format
and read.phylip.format
will read in
original coding without any transformation as code.type = NULL
in write.fasta
and write.phylip
. Suppose these functions
return an object ret
, one can write other functions ret2aa()
to post transform the coding and replace ret$org
by the results of
ret2aa(ret$org.code)
.
byrow
indicates the data will be store by row or not. Usually,
the default is TRUE. The FALSE is only for advance users
with careful manipulations and for speeding up the bootstraps.
sep
can specify a character which is used to split sites in file.
By default, "" denote no character between sites. Only "CODON" id requires
a character to avoid ambiguity
write.fasta
,
write.phylip
.# PHYLIP
data.path <- paste(.libPaths()[1], "/phyclust/data/crohn.phy", sep = "")
(my.snp <- read.phylip(data.path, code.type = "SNP"))
# FASTA
data.path <- paste(.libPaths()[1], "/phyclust/data/pony625.fas", sep = "")
(my.pony <- read.fasta(data.path))
Run the code above in your browser using DataLab