Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache modification resolvers (temporary patch); version bump #79

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.3] - 2024-04-16

### Added

- Speed up mass calculation for large datasets by caching Proforma modification resolvers.
Temporary patch until implemented in Pyteomics (see levitsky/pyteomics#147).

## [0.8.2] - 2024-04-05

### Added
Expand Down
21 changes: 17 additions & 4 deletions psm_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Common utilities for parsing and handling PSMs, and search engine results."""

__version__ = "0.8.2"
__version__ = "0.8.3"
__all__ = ["Peptidoform", "PSM", "PSMList"]

from functools import lru_cache
from warnings import filterwarnings

# mzmlb is not used, so hdf5plugin is not needed
Expand All @@ -12,6 +14,17 @@
module="psims.mzmlb",
)

from psm_utils.peptidoform import Peptidoform # noqa: E402, F401
from psm_utils.psm import PSM # noqa: E402, F401
from psm_utils.psm_list import PSMList # noqa: E402, F401
from pyteomics.proforma import ( # noqa: E402
GenericResolver,
PSIModResolver,
UnimodResolver,
)

from psm_utils.peptidoform import Peptidoform # noqa: E402
from psm_utils.psm import PSM # noqa: E402
from psm_utils.psm_list import PSMList # noqa: E402

# Temporary patch until released in pyteomics (see levitsky/pyteomics#147)
UnimodResolver.resolve = lru_cache(maxsize=None)(UnimodResolver.resolve)
PSIModResolver.resolve = lru_cache(maxsize=None)(PSIModResolver.resolve)
GenericResolver.resolve = lru_cache(maxsize=None)(GenericResolver.resolve)
Loading