library(mauricer)
#> Loading required package: beastier
library(testthat)
List all BEAST2 packages:
if (beastier::is_beast2_installed()) {
beast2_packages <- get_beast2_pkg_names()
knitr::kable(head(beast2_packages))
}
name | installed_version | latest_version | dependencies | description |
---|---|---|---|---|
BEAST | 2.5.2 | 2.5.0 | BEAST core | |
bacter | NA | 2.2.1 | Bacterial ARG inference. | |
BADTRIP | NA | 1.0.0 | Infer transmission time for non-haplotype data and epi data | |
BASTA | NA | 3.0.1 | Bayesian structured coalescent approximation | |
bdmm | NA | 0.3.3 | MultiTypeTree, MASTER | pre-release of multitype birth-death model (aka birth-death-migration model) |
BDSKY | NA | 1.4.5 | birth death skyline - handles serially sampled tips, piecewise constant rate changes through time and sampled ancestors |
Find a package that is not installed:
if (beastier::is_beast2_installed()) {
first_absent_package_name <- beast2_packages[
beast2_packages$installed_version == "NA",
]$name[1]
print(first_absent_package_name)
}
#> [1] "bacter"
Check that is indeed not installed:
if (beastier::is_beast2_installed()) {
expect_false(is_beast2_pkg_installed(first_absent_package_name))
}
Install that package:
if (beastier::is_beast2_installed()) {
install_beast2_pkg(first_absent_package_name)
}
Should not be the first absent package anymore:
if (beastier::is_beast2_installed()) {
beast2_packages <- get_beast2_pkg_names()
new_first_absent_package_name <- beast2_packages[
beast2_packages$installed_version == "NA",
]$name[1]
expect_true(new_first_absent_package_name != first_absent_package_name)
}
Uninstall that package:
if (beastier::is_beast2_installed()) {
uninstall_beast2_pkg(first_absent_package_name)
}
Should be the first absent package again:
if (beastier::is_beast2_installed()) {
beast2_packages <- get_beast2_pkg_names()
last_first_absent_package_name <- beast2_packages[
beast2_packages$installed_version == "NA",
]$name[1]
expect_equal(last_first_absent_package_name, first_absent_package_name)
}