R/load_data.R

#' Loads sequence files
#'
#' Loads sequence files
#'
#' @param file_name The full or relative path and name of the file
#' @param file_type The type of file. Default: FASTA
#' @export

read_seq <- function(file_name, file_type = 'FASTA'){
  if (tolower(file_type) == 'fasta'){
    dat <- seqinr::read.fasta(file_name)
    dat <- sapply(dat, paste, collapse = '')
  } else {
    stop(paste('File type ', file_type, ' not supported.', sep = ''))
  }
  return(dat)
}
philliplab/seqR documentation built on June 15, 2019, 12:05 a.m.