convert_to_regex_pattern: Convert Peptide Sequence to Regex Pattern

View source: R/sequence_matching_functions.R

convert_to_regex_patternR Documentation

Convert Peptide Sequence to Regex Pattern

Description

This function converts a peptide sequence into a regular expression pattern that accounts for ambiguous amino acids. Each amino acid is replaced by a character class that includes itself, 'X', and any specific ambiguities.

Usage

convert_to_regex_pattern(peptide)

Arguments

peptide

A character string representing the peptide sequence.

Value

A character string containing the regex pattern for matching.

Examples

# Convert a peptide sequence to a regex pattern
peptide <- "NDEQIL"
regex_pattern <- convert_to_regex_pattern(peptide)
print(regex_pattern) # Output: "[NBX][DBX][EZX][QZX][ILX][ILX]"

PepMapViz documentation built on April 3, 2025, 6:29 p.m.