From 37d95cc56cf9b2522082835678f5023c82b4defc Mon Sep 17 00:00:00 2001 From: zhuchcn Date: Sun, 26 May 2024 11:19:53 -0700 Subject: [PATCH] fix (VariantPeptidePool): old versions of SeqUtils.molecular_weight don't handle SeqRecord objects. #874 --- CHANGELOG.md | 4 ++++ moPepGen/__init__.py | 2 +- moPepGen/aa/VariantPeptidePool.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da7e4dc6..819482c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +## [1.4.1] - 2024-05-26 + +- Fixed `VariantPepidePool` that old versions of `SeqUtils.molecular_weight` don't handle `SeqRecord` objects. #874 + ## [1.4.0] - 2024-03-27 - `--coding-novel-orf` added to `callNoncoding` and `callVariant` to call novel ORF peptides from coding transcripts. #659 diff --git a/moPepGen/__init__.py b/moPepGen/__init__.py index c9955db4..053f60d1 100644 --- a/moPepGen/__init__.py +++ b/moPepGen/__init__.py @@ -8,7 +8,7 @@ from . import constant -__version__ = '1.4.0' +__version__ = '1.4.1' ## Error messages ERROR_INDEX_IN_INTRON = 'The genomic index seems to be in an intron' diff --git a/moPepGen/aa/VariantPeptidePool.py b/moPepGen/aa/VariantPeptidePool.py index 1174c8cd..0f9fb160 100644 --- a/moPepGen/aa/VariantPeptidePool.py +++ b/moPepGen/aa/VariantPeptidePool.py @@ -36,9 +36,9 @@ def add_peptide(self, peptide:AminoAcidSeqRecord, min_mw = cleavage_params.min_mw min_length = cleavage_params.min_length max_length = cleavage_params.max_length - if SeqUtils.molecular_weight(peptide, 'protein') < min_mw: + if SeqUtils.molecular_weight(peptide.seq, 'protein') < min_mw: return False - if len(peptide.seq) < min_length or len(peptide) > max_length: + if len(peptide.seq) < min_length or len(peptide.seq) > max_length: return False if str(peptide.seq) in canonical_peptides: return False