R/is_locatome_line.R

Defines functions is_locatome_line

Documented in is_locatome_line

#' Is the line of text the locatome, as used within
#' a FASTA filename?
#' @param line line of text from a FASTA filename
#' @examples
#' # A valid locatome line
#' is_locatome_line("oooooMMMMMiiiii")
#'
#' # An invalid locatome line
#' is_locatome_line("nonsense")
#' @export
is_locatome_line <- function(line) {
  if (!is.character(line)) return(FALSE)
  if (nchar(line) == 0) return(FALSE)
  stringr::str_count(line, pattern = "(i|M|o)") == nchar(line)
}

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.