amino_acid_pairs: Generate amino acid pairs

View source: R/amino_acid_pairs.R

amino_acid_pairsR Documentation

Generate amino acid pairs

Description

This function generates combinations of amino acids in pairs. By default, it generates all pair combinations of the 20 standard amino acids.

Usage

amino_acid_pairs(
  x = amino_acids(),
  y = amino_acids(),
  keep_self = TRUE,
  keep_duplicates = TRUE,
  keep_reverses = TRUE
)

Arguments

x

A character vector of amino acids (three-letter codes).

y

Another character vector of amino acids (three-letter codes).

keep_self

Whether to keep pairs involving the same amino acid.

keep_duplicates

Whether to keep duplicated pairs.

keep_reverses

Whether to keep pairs that are reversed versions of others. E.g. if keep_reverses is TRUE the pairs "Ser"-"Arg" and "Arg"-"Ser" will be kept in the returned tibble; however, if keep_reverses is FALSE, only the first pair is preserved in the output.

Value

A tibble of amino acid pairs.

Examples

# Generate all pairs of the 20 standard amino acids
amino_acid_pairs()

# Remove the self-to-self pairs
amino_acid_pairs(keep_self = FALSE)

# Generate specific combinations of Ser against Ala and Trp.
amino_acid_pairs(x = 'Ser', y = c('Ala', 'Trp'))

maialab/grantham documentation built on Aug. 1, 2024, 2:32 a.m.