R/is_protein.R

Defines functions is_protein

Documented in is_protein

#' Protein test
#'
#' Checks if an object is a protein (contains letters from one-letter amino acid code).
#'
#' @param object \code{character} vector where each elemenents represent one amino acid.
#' @return \code{TRUE} or \code{FALSE}.
#' @export

is_protein <- function(object) {
  #only amino acids
  all(toupper(object) %in% c(a()[-1], "X", "J", "Z", "B", "U"))
}
michbur/AmyloGram documentation built on May 25, 2020, 7:13 a.m.