R/is_protein_name_line.R

Defines functions is_protein_name_line

Documented in is_protein_name_line

#' Is the line of text the name of a protein, as used within
#' a FASTA filename?
#' @param line line of text from a FASTA filename
#' @examples
#' # A valid protein name line
#' is_protein_name_line(">5H2A_CRIGR")
#'
#' # An invalid protein name line:
#' # need the '>' before the protein name
#' is_protein_name_line("5H2A_CRIGR")
#'
#' # An invalid protein name line
#' is_protein_name_line("nonsense")
#' @export
is_protein_name_line <- function(line) {
  if (!is.character(line)) return(FALSE)
  substr(line, 1, 1) == ">"
}

Try the tmhmm package in your browser

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

tmhmm documentation built on Nov. 18, 2020, 9:07 a.m.