From 7e27429101f0d8079b2e7f0d0ebf3e4f1a7a880e Mon Sep 17 00:00:00 2001 From: Klaus Schliep Date: Wed, 20 Nov 2024 14:12:57 +0100 Subject: [PATCH] add test --- inst/tinytest/test_pml_generics.R | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/inst/tinytest/test_pml_generics.R b/inst/tinytest/test_pml_generics.R index 05602a8c..e93ca787 100644 --- a/inst/tinytest/test_pml_generics.R +++ b/inst/tinytest/test_pml_generics.R @@ -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"))