Finding motifs by hand

Finding motifs by hand#

Write a function find_nglycosylation_motif that scans a list of amino acids to find the index of the beginning of an N-glycosylation motif; if it’s not found, you should raise a ValueError.

For example:

>>> find_nglycosylation_motif(list('AAMNLSRPPT'))
>>> find_nglycosylation_motif(list('MNPSNTTT'))
>>> find_nglycosylation_motif(list('PATTY'))
ValueError: N-glycosylation motif not found

Write tests (using doctest or unittest or assert) to check your work. (We won’t be ‘marking’ it—convince yourself you got it right!)