R/check_alignment.R

Defines functions check_alignment

Documented in check_alignment

#' Check if the alignment is of the right type
#'
#' Will \link{stop} if not.
#' @inheritParams default_params_doc
#' @return nothing
#' @author Richèl J.C. Bilderbeek
#' @examples
#' # Cleanup
#' beastier::remove_beaustier_folders()
#' beastier::check_empty_beaustier_folders()
#'
#' # Check cleanup by other functions
#' beastier::check_empty_beaustier_folders()
#'
#' check_alignment(ape::as.DNAbin("ACGT"))
#'
#' # Cleanup
#' beastier::remove_beaustier_folders()
#' beastier::check_empty_beaustier_folders()
#' @export
check_alignment <- function(alignment) {
  if (!inherits(alignment, "DNAbin")) {
    stop("'alignment' must be of class 'ape::DNAbin'")
  }
  invisible(alignment)
}

Try the pirouette package in your browser

Any scripts or data that you put into this service are public.

pirouette documentation built on Oct. 7, 2023, 9:06 a.m.