levitsky / pyteomics

Pyteomics is a collection of lightweight and handy tools for Python that help to handle various sorts of proteomics data. Pyteomics provides a growing set of modules to facilitate the most common tasks in proteomics data analysis.
http://pyteomics.readthedocs.io
Apache License 2.0
105 stars 34 forks source link

Add modification caching; Constant terminal mods for ProForma #148

Closed mobiusklein closed 2 months ago

mobiusklein commented 2 months ago

Modification caching

All ModificationResolver types now use an in-memory cache for resolved modification definitions, reducing overhead of resolving the same rule over and over again.

Sub-classes should move their implementation of resolve to the _resolve_impl method, otherwise the cache will not be used.

To disable the cache for a resolver instance, call resolver.enable_caching(False).

Constant terminal modifications

This implements support for the syntax discussed in https://github.com/HUPO-PSI/ProForma/issues/6 to include constant modification rules that apply to specific sequence terminals with or without specific amino acids.