Package 'mauricer'

Title: Work with 'BEAST2' Packages
Description: 'BEAST2' (<https://www.beast2.org>) is a widely used Bayesian phylogenetic tool, that uses DNA/RNA/protein data and many model priors to create a posterior of jointly estimated phylogenies and parameters. 'BEAST2' is commonly accompanied by 'BEAUti 2' (<https://www.beast2.org>), which, among others, allows one to install 'BEAST2' package. This package allows to work with 'BEAST2' packages from 'R'.
Authors: Richèl J.C. Bilderbeek [aut, cre] , Olivier Roy [ctb]
Maintainer: Richèl J.C. Bilderbeek <[email protected]>
License: GPL-3
Version: 2.5.5
Built: 2024-09-06 06:20:04 UTC
Source: https://github.com/ropensci/mauricer

Help Index


This function does nothing. It is intended to inherit is parameters' documentation.

Description

This function does nothing. It is intended to inherit is parameters' documentation.

Usage

default_params_doc(beast2_folder, has_internet, name, show_warnings, verbose)

Arguments

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

has_internet

boolean to indicate if the user has access to the internet. By default, this value equals the result of curl::has_internet

name

the package's name

show_warnings

set to TRUE to show warnings

verbose

set to TRUE for extra output, as can be used in debugging

Note

This is an internal function, so it should be marked with @noRd. This is not done, as this will disallow all functions to find the documentation parameters

Author(s)

Richèl J.C. Bilderbeek


Get all BEAST2 package names

Description

List all BEAST2 packages that are available and installed. Will stop if there is no internet connection

Usage

get_beast2_pkg_names(
  beast2_folder = beastier::get_default_beast2_folder(),
  has_internet = curl::has_internet(),
  verbose = FALSE
)

Arguments

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

has_internet

boolean to indicate if the user has access to the internet. By default, this value equals the result of curl::has_internet

verbose

set to TRUE for extra output, as can be used in debugging

Value

a data frame with columns

  1. name package name, for example, bdmm

  2. installed_version the installed version, for example, 2.6.2. installed_version will be NA if the package is not installed

  3. latest_version version number of the latest version, for example, 2.6.3

  4. dependencies packages the package depends on, for example BEASTLabs, GEO_SPHERE. dependencies will be empty if there are no dependencies

  5. description description of the package, for example Nested sampling for model selection and posterior inference

Author(s)

Richèl J.C. Bilderbeek

Examples

if (beastier::is_beast2_installed() && curl::has_internet()) {
  get_beast2_pkg_names()
}

Get the full path of a mauricer file

Description

Get the full path of a file in the inst/extdata folder. If there is no mauricer file, get_mrc_path will stop.

Usage

get_mrc_path(filename)

Arguments

filename

the file's name, without the path

Value

the full path of the filename, if and only if the file is present. Will stop otherwise.

Author(s)

Richèl J.C. Bilderbeek

See Also

for more files, use get_mrc_paths

Examples

get_mrc_path("anthus_aco_sub.fas")

Get the full path of one or more mauricer files

Description

Get the full paths of files in the inst/extdata folder If there is a mauricer file absent, get_mrc_paths will stop.

Usage

get_mrc_paths(filenames)

Arguments

filenames

the files' names, without the path

Value

the filenames' full paths

Author(s)

Richèl J.C. Bilderbeek

See Also

for one file, use get_mrc_path

Examples

get_mrc_paths(c("anthus_aco_sub.fas", "anthus_nd2_sub.fas"))

Install a BEAST2 package

Description

Install a BEAST2 package. If the package is already installed, (see is_beast2_pkg_installed), this function stops.

Usage

install_beast2_pkg(
  name,
  beast2_folder = beastier::get_default_beast2_folder(),
  verbose = FALSE,
  has_internet = curl::has_internet()
)

Arguments

name

the package's name

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

verbose

set to TRUE for extra output, as can be used in debugging

has_internet

boolean to indicate if the user has access to the internet. By default, this value equals the result of curl::has_internet

Value

nothing. It does install the BEAST2 package

Note

Installing or uninstalling a BEAST2 package for a (singular) BEAST2 installation, does so for all BEAST2 installations

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  install_beast2_pkg("NS")

## End(Not run)

Is the BEAST2 NS package installed?

Description

Determine if the BEAST2 NS package is installed.

Usage

is_beast2_ns_pkg_installed(
  show_warnings = FALSE,
  verbose = FALSE,
  beast2_folder = beastier::get_default_beast2_folder()
)

Arguments

show_warnings

set to TRUE to show warnings

verbose

set to TRUE for extra output, as can be used in debugging

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

Details

Unlike is_beast2_pkg_installed, this function does not need an internet connection. Instead, the function calls BEAST2 to read a BEAST2 XML file that uses NS.

Value

TRUE if the BEAST2 NS package is installed, FALSE otherwise

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  is_beast2_ns_pkg_installed()

## End(Not run)

Is a BEAST2 package installed?

Description

Checks if a BEAST2 package is installed.

Usage

is_beast2_pkg_installed(
  name,
  beast2_folder = beastier::get_default_beast2_folder(),
  has_internet = curl::has_internet()
)

Arguments

name

the package's name

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

has_internet

boolean to indicate if the user has access to the internet. By default, this value equals the result of curl::has_internet

Details

To be able to check this, an internet connection is needed. Without an internet connection, NULL is returned.

Value

  • TRUE if the BEAST2 package is installed

  • FALSE if the BEAST2 package is not installed

  • NULL if there is no internet connection

Author(s)

Richèl J.C. Bilderbeek

See Also

Use is_beast2_ns_pkg_installed to see if the NS package is installed without an internet connection

Examples

## Not run: 
  is_beast2_pkg_installed("Beasy")

## End(Not run)

Uninstall a BEAST2 package

Description

Uninstall a BEAST2 package

Usage

uninstall_beast2_pkg(
  name,
  beast2_folder = beastier::get_default_beast2_folder(),
  verbose = FALSE,
  has_internet = curl::has_internet()
)

Arguments

name

the package's name

beast2_folder

the folder where the BEAST2 is installed. Note that this is not the folder where the BEAST2 executable is installed: the BEAST2 executable is in a subfolder. Use get_default_beast2_folder to get the default BEAST2 folder. Use get_default_beast2_bin_path to get the full path to the default BEAST2 executable. Use get_default_beast2_jar_path to get the full path to the default BEAST2 jar file.

verbose

set to TRUE for extra output, as can be used in debugging

has_internet

boolean to indicate if the user has access to the internet. By default, this value equals the result of curl::has_internet

Value

nothing. It does install the BEAST2 package

Note

Installing or uninstalling a BEAST2 package for a (singular) BEAST2 installation, does so for all BEAST2 installations

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  uninstall_beast2_pkg("Beasy")

## End(Not run)