amino_acid_pairs: Generate amino acid pairs

Description Usage Arguments Value Examples

View source: R/amino_acid_pairs.R

Description

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

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
6
7
8
# 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'))

grantham documentation built on Jan. 7, 2022, 9:06 a.m.