R/create_random_extreme_peptide.R

Defines functions create_random_extreme_peptide

Documented in create_random_extreme_peptide

#' Create a random peptide likelier to have an
#' extreme hydrophobicity
#' @inheritParams default_params_doc
#' @author Richèl J.C. Bilderbeek
#' @export
create_random_extreme_peptide <- function(peptide_length) {
  aas <- Peptides::aaList()
  hs <- Peptides::hydrophobicity(aas)
  prob <- abs(hs ^ 5)
  paste0(
    sample(
      x = aas, size = peptide_length, replace = TRUE, prob = prob),
    collapse = ""
  )
}
richelbilderbeek/bbbq documentation built on July 27, 2023, 2:15 a.m.