R/msaBP.R

Defines functions msaBP

Documented in msaBP

#' @title Bootstrap a Multiple Sequence Alignnment
#' @description Create a bootstrap replicate of multiple sequence alignment.
#' @param msa An object of class \code{\link{DNAbin}} or \code{\link{AAbin}}.
#' @export

msaBP <- function(msa){

  if (!inherits(msa, c("DNAbin", "AAbin")))
    stop("'msa' not of class DNAbin or AAbin (ape)")

  msa[, sample(ncol(msa), replace = TRUE)]
}
heibl/polenta documentation built on May 17, 2019, 3:22 p.m.