phyDat
format.
allSitePattern
generates an alignment of all possible site patterns.phyDat(data, type = "DNA", levels = NULL, return.index=TRUE, ...)
read.phyDat(file, format="phylip", type="DNA", ...)
write.phyDat(x, file, format="phylip",...)
## S3 method for class 'DNAbin':
as.phyDat(x, ...)
## S3 method for class 'phyDat':
as.character(x, allLevels = TRUE, ...)
## S3 method for class 'phyDat':
as.data.frame(x, ...)
## S3 method for class 'phyDat':
as.DNAbin(x, ...)
## S3 method for class 'phyDat':
subset(x, subset, select, site.pattern = TRUE, ...)
allSitePattern(n, levels=c("a","c","g","t"), names=NULL)
acgt2ry(obj)
baseFreq(obj, freq=FALSE, drop.unused.levels=FALSE)
phyDat
.type
"USER" a vector has to be give to levels
.
For example c("a", "c", "g", "t", "-") would create a data object that
can be used in phylogenetic analysis with gaps as fifth state.
allSitePattern
returns all possible site patterns and can
be useful in simulation studies. For further details see the vignette
phangorn-specials.
write.phyDat
calls the function write.dna or write.nexus.data and
read.phyDat
calls the function read.dna, read.aa or read.nexus.data
see for more details over there.
You may import data directly with read.dna
or read.nexus.data
and convert the data to class phyDat.
The generic function c
can be used to to combine sequences and unique
to get
all unique sequences or unique haplotypes.
acgt2ry
converts a phyDat
object of nucleotides into an binary ry-coded dataset.
There is a more detailed example for specifying USER defined data formats in the vignette advanced features.DNAbin
, as.DNAbin
, read.dna
, read.aa
and read.nexus.data
and
the example of pmlMix
for the use of allSitePattern
data(Laurasiatherian)
class(Laurasiatherian)
Laurasiatherian
baseFreq(Laurasiatherian)
subset(Laurasiatherian, subset=1:5)
# transform into old ape format
LauraChar <- as.character(Laurasiatherian)
# and back
Laura <- phyDat(LauraChar, return.index=TRUE)
all.equal(Laurasiatherian, Laura)
allSitePattern(5)
Run the code above in your browser using DataLab