Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This regex is a complex pattern used for identifying signal peptide cleavage sites in protein sequences. Let me break it down:
- ```
- rf'(?:(?<=.{{{constants.SIGNAL_PEPTIDE_LENGTH}}})(?:(?<!K|R)(?:KK|KR|RR|RK)(?=[^RKILPVH]|(?<=KR)H|$))(?=(?:(?!(?R)).){{{self.cleavage_spacing},}}|$))'
- ```
- 1. `rf'...'` - This is an f-string with the 'r' prefix, meaning it's both a raw string and allows for variable interpolation.
- 2. `(?<=.{{{constants.SIGNAL_PEPTIDE_LENGTH}}})` - This is a positive lookbehind assertion that checks if the pattern is preceded by exactly `constants.SIGNAL_PEPTIDE_LENGTH` characters. This ensures the cleavage site occurs after the signal peptide.
- 3. `(?:(?<!K|R)(?:KK|KR|RR|RK)` - This part:
- - `(?<!K|R)` is a negative lookbehind ensuring the pattern isn't preceded by K or R
- - `(?:KK|KR|RR|RK)` matches one of the dibasic motifs: KK, KR, RR, or RK
- 4. `(?=[^RKILPVH]|(?<=KR)H|$))` - This is a positive lookahead that ensures:
- - The next character is not one of R, K, I, L, P, V, or H
- - OR it's H but only if preceded by KR
- - OR it's the end of the string
- 5. `(?=(?:(?!(?R)).){{{self.cleavage_spacing},}}|$)` - This complex lookahead:
- - `(?R)` is a recursive pattern reference (supported in some regex engines like PCRE)
- - `(?!(?R)).` matches any character that doesn't start a recursive match
- - `{{{self.cleavage_spacing},}}` specifies that at least `self.cleavage_spacing` such characters must follow
- - `|$` alternatively matches the end of the string
- This regex appears to be identifying dibasic cleavage sites (KK, KR, RR, RK) that:
- 1. Occur after a signal peptide of specific length
- 2. Are not preceded by K or R (avoiding overlapping motifs)
- 3. Are followed by specific amino acid constraints
- 4. Have a minimum spacing before any subsequent cleavage site
- This is likely used in bioinformatics for identifying proteolytic cleavage sites in precursor proteins, particularly for prohormone or neuropeptide processing.
Advertisement
Add Comment
Please, Sign In to add comment