Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Created April 8, 2019 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenFordham/85e51dd8ab26eaf961478d6d05aa5003 to your computer and use it in GitHub Desktop.
Save StephenFordham/85e51dd8ab26eaf961478d6d05aa5003 to your computer and use it in GitHub Desktop.
Character_groups_example
import re
N_glycosylation_pattern = 'N[^P][ST][^P]'
# putting a caret ^ at the start of the group will negate it
# and match any character that is not in that group
Protein_seq = 'YHWKYELIQNNSNEFC'
if re.search(N_glycosylation_pattern, Protein_seq):
print("N-glycosylation site motif found")
else:
print("No motif found")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment