phyDat | R Documentation |
These functions transform several DNA formats into the phyDat
format.
allSitePattern
generates an alignment of all possible site patterns.
phyDat(data, type = "DNA", levels = NULL, return.index = TRUE, ...) as.phyDat(x, ...) ## S3 method for class 'factor' as.phyDat(x, ...) ## S3 method for class 'DNAbin' as.phyDat(x, ...) ## S3 method for class 'alignment' as.phyDat(x, type = "DNA", ...) phyDat2alignment(x) ## S3 method for class 'MultipleAlignment' as.phyDat(x, ...) ## S3 method for class 'phyDat' as.MultipleAlignment(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' as.AAbin(x, ...) genlight2phyDat(x, ambiguity = NA) acgt2ry(obj)
data |
An object containing sequences. |
type |
Type of sequences ("DNA", "AA", "CODON" or "USER"). |
levels |
Level attributes. |
return.index |
If TRUE returns a index of the site patterns. |
... |
further arguments passed to or from other methods. |
x |
An object containing sequences. |
allLevels |
return original data. |
ambiguity |
character for ambiguous character and no contrast is provided. |
obj |
as object of class phyDat |
If 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. There is a more detailed
example for specifying "USER" defined data formats in the vignette
"phangorn-specials".
acgt2ry
converts a phyDat
object of nucleotides into an binary
ry-coded dataset.
The functions return an object of class phyDat
.
Klaus Schliep klaus.schliep@gmail.com
[DNAbin()], [as.DNAbin()],
baseFreq
, glance.phyDat
,
read.dna
, read.aa
, read.nexus.data
and the chapter 1 in the vignette("phangorn-specials",
package="phangorn")
and the example of pmlMix
for the use of
allSitePattern
data(Laurasiatherian) class(Laurasiatherian) Laurasiatherian # transform as characters LauraChar <- as.character(Laurasiatherian) # and back Laura <- phyDat(LauraChar) all.equal(Laurasiatherian, Laura) LauraDNAbin <- as.DNAbin(Laurasiatherian) all.equal(Laurasiatherian, as.phyDat(LauraDNAbin))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.