Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausVigo committed Nov 20, 2024
1 parent faec65d commit 7e27429
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions inst/tinytest/test_pml_generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,24 @@ expect_true(BIC(fit) > AIC(fit))

c_mat <- vcov(fit)
expect_true( isSymmetric(c_mat, tol=1e-12) )

# test write.pml
write.pml(fit, save_rds = TRUE)
fit2 <- readRDS("pml.rds")
expect_equal(fit, fit2)



#write.pml(fit, save_rds = FALSE)

#tree <- read.tree("pml_tree.nwk")
#align <- read.phyDat("pml_align.fasta", format="fasta")
#fit3 <- pml(tree = tree, data = align, k = 1L, site.rate = "gamma", ASC = FALSE,
# bf = c(0.306541405706333, 0.261308281141267, 0.126026443980515,
# 0.306123869171886),
# Q = c(1, 23.0401288315219, 1, 1, 23.0401288315219, 1),
# inv = 0.850681761772363, model = "HKY")

#fit$method <- NULL
#expect_equal(fit, fit3)
unlink(c("pml_align.fasta", "pml_tree.nwk", "pml.rds", "pml.txt"))

0 comments on commit 7e27429

Please sign in to comment.