file.read {phyclust} | R Documentation |
Two major file formats are supported in phyclust,
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 = "")
filename |
a file name where data is read from. |
byrow |
advanced option, default = TRUE. |
code.type |
either "NUCLEOTIDE" (default) or "SNP". |
aligned |
indicate aligned data. |
sep |
use to split sites, "" (default) and "," for "CODON". |
For unaligned sequences, 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
Return an object in Class seq.data
.
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: http://snoweye.github.io/phyclust/
## Not run: library(phyclust, quiet = TRUE) # 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)) ## End(Not run)