Skip to content
Advertisement

regex match not working on simple string with Pyteomics parser

I am performing an in silico digestion of the human proteome, meaning that I am trying to chopped the amino acid sequence of every protein at a certain position. I am using the Pyteomics parser function Pyteomics Parser within a bigger function that I have created.

I am getting this error: PyteomicsError: Pyteomics error, message: “Not a valid modX sequence: {‘sequence’: ‘AKDEVQKN’}”

However, I am unsure how AKDEVQKN doesn’t match the modX_reqquence compilier:

JavaScript

From my understanding of this regex, it should find any string that doesn’t start with (-) and is followed by a series of alphabetical characters.

This is the function I am trying to use it on.

JavaScript

Thank you for any insight on how to address this.

** Update: If I run on a different set, I am getting the same error which may suggest it is the library itself.

Screenshot of Error: Error

Advertisement

Answer

Pyteomics maintainer here.

The error message actually tells you the source of the problem: PyteomicsError: Pyteomics error, message: "Not a valid modX sequence: {'sequence': 'AKDEVQKN'}"

It means that instead of a string 'AKDEVQKN' you passed a dictionary {'sequence': 'AKDEVQKN'}. This actually happens here:

JavaScript

You should pass the sequence itself to parse, not the dict:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement