R/is_tmh.R

Defines functions is_tmh

Documented in is_tmh

#' Determine if the protein sequence contains at least one TMH.
#' @inheritParams default_params_doc
#' @examples
#' if (is_tmhmm_installed()) {
#'   # A TMH
#'   is_tmh("VVIILTIAGNILVIMAVSLE")
#'
#'   # A protein without a TMH
#'   is_tmh("VVIILTIRGNILVIMAVSLE")
#' }
#' @export
is_tmh <- function(protein_sequence) {
  tmhmm::check_tmhmm_installation()

  locatome <- tmhmm::run_tmhmm_on_sequence(protein_sequence)
  stringr::str_count(string = locatome, pattern = "(M|m)") > 0
}
richelbilderbeek/tmhmm documentation built on Sept. 3, 2022, 5:14 p.m.