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

Unparsable modifications are silently ignored in ProForma mass calculation #157

Closed
caetera opened this issue Sep 27, 2024 · 1 comment · Fixed by #158
Closed

Unparsable modifications are silently ignored in ProForma mass calculation #157

caetera opened this issue Sep 27, 2024 · 1 comment · Fixed by #158

Comments

@caetera
Copy link
Contributor

caetera commented Sep 27, 2024

Hello,

I discovered a quirky "attitude" of ProForma parsing.

If a ProForma object has a modification that cannot be decoded this modification is silently ignored in all further calculations, while the same calculation on the modification object raises. I believe it will be better to propagate the Exception rather than silencing it.

Here is an example (Pyteomics 4.7.2 Python 3.10.2 Win64)

Both raise KeyError

proforma.GenericModification('Generic').mass

proforma.UnimodModification('123456').mass

However - this works while ignoring the modification

for peptide in ['PEPTIDE', 'PEPTID[Generic]E', 'PEPTID[UNIMOD:123456]E']:
    prof = proforma.ProForma.parse(peptide)
    print(f'{prof}\n{prof.mass}\n')
PEPTIDE
799.3599640267099

PEPTID[Generic]E
799.3599640267099

PEPTID[UNIMOD:123456]E
799.3599640267099
@mobiusklein
Copy link
Contributor

This is likely an oversight on my part. I'll investigate why I silenced the exceptions in ProForma methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants