Let's have two matrices, one DNA sequence alignment and one consisting of binary characters.
dna <- matrix(c("a", "a", "a", "t", "a", "a",
"t", "t", "a", "g", "c", "c"),
ncol = 4, dimnames = list(LETTERS[1:3], NULL))
bi <- matrix(c(0,0,1,0,1,1,1,0,0,1,0,0),
ncol = 4, dimnames = list(LETTERS[1:3], NULL))
We can reconstruct the phylogenetic relationships with the phangorn
package:
library(phangorn)
dnatr <- optim.pml(pml(tree = rtree(3, tip.label = LETTERS[1:3]),
data = phyDat(dna)),
optNni = TRUE)
bitr <- optim.pml(pml(tree = rtree(3, tip.label = LETTERS[1:3]),
data = phyDat(bi, type= "USER", levels = c(0,1))),
optNni = TRUE)
Function phangorn::pmlPart
should run partitioned analyses, but it does not combine the phylogenetic information in partitions to reconstruct a single phylogeny.
tr = pmlPart(~ edge + nni, object = list(dnatr, bitr))
How can I set up a partitioned analysis that uses mixed datatypes (DNA sequences and a binary character)?