filter_residues {peptoolkit}R Documentation

Filter Peptides by Residue Counts

Description

This function counts the number of specified residues in each peptide sequence and filters out the ones with more than the specified limit. It's defaults is for filtering out small alliphatic residues.

Usage

filter_residues(
  df,
  sequence_col = "Sequence",
  residues = c("A", "V", "I", "L", "G"),
  max_residues = 2
)

Arguments

df

A data frame containing peptide sequences.

sequence_col

The name of the column that contains the sequences.

residues

A character vector of residues to count.

max_residues

The maximum number of allowed residues.

Value

A filtered data frame.

Examples

# Generate a mock data frame
peptide_data <- data.frame(Sequence = c("AVILG", "VILGA", "ILGAV", "LGAVI"))
# Apply the function to the mock data
filter_residues(peptide_data, residues = c("A", "V", "I", "L", "G"), max_residues = 2)

[Package peptoolkit version 0.0.1 Index]