R/stringdist_ape.R

#' To find the scores between strings using ape distance
#' @param sequences a list of character vectors, the sequences we are analysing
#' @return A dist object of the pairwise K-80 distances between the sequences
#' @export
stringdist_ape <- function(sequences)
{
  tryCatch({
      ans <- ape::dist.dna(ape::as.DNAbin(sequences))
    },
    error = function(e) {
      print(sequences)
      print("Error")
      print(e)
      ans <- NULL
    },
    warning = function(w)
    {
      print(w)
    }
  )
  return(ans)
}
sams25/rcombinator_old documentation built on May 28, 2019, 8:40 a.m.