Skip to content

Commit

Permalink
update phangorn
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Sep 21, 2023
1 parent cbb141b commit 085cda7
Show file tree
Hide file tree
Showing 3 changed files with 1,003 additions and 1 deletion.
25 changes: 24 additions & 1 deletion inst/scripts/phagorn.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
library(phangorn)

x <- m3


x[x > 0] <- 1
x <- x[,sort(colnames(x))]
rownames(x) <- NULL
Expand All @@ -13,6 +16,7 @@ for (i in seq_along(output)) {
}
rownames(y) <- output


trait_mat <- m3[, sort(colnames(m3))]
trait_mat[trait_mat > 0] <- 1
trait_v <- vector('character', nrow(trait_mat))
Expand Down Expand Up @@ -46,10 +50,29 @@ system.time(
{
## This one takes too long
fit <- pml(mpa_tree, myData)
fit <- optim.pml(fit, model = NULL, control = pml.control(trace=0))
# fit <- optim.pml(fit, model = NULL, control = pml.control(trace=0))
}
)

system.time(
anc.ml <- ancestral.pml(fit, "ml")
)


system.time(
anc.ml <- ancestral.pml(fit, "ml")
)

system.time(
anc.bayes <- ancestral.pml(fit, "bayes")
)







anc_pars_data <- vector('list', length(anc_pars))
for (i in seq_along(anc_pars_data)) {
anc_pars_data[[i]] <- as.data.frame(unname(anc_pars[[i]]))
Expand Down
Loading

0 comments on commit 085cda7

Please sign in to comment.