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

Duplicate modifications cause crashes #62

Open
paretje opened this issue Apr 24, 2020 · 0 comments
Open

Duplicate modifications cause crashes #62

paretje opened this issue Apr 24, 2020 · 0 comments
Assignees
Labels

Comments

@paretje
Copy link
Contributor

paretje commented Apr 24, 2020

In Python, we use the modification name as a unique identifier of a modification. When we have multiple modification with the same name, we just overwrite the previous modification. However, this causes a couple of issues:

  1. Modifications with the same name but different amino acid are silently ignored in Python
  2. Any modification with duplicate names cause a new mod_id to be picked. We write these modifications to the disk, and then parse the files in C. The first line is the number of modifications. C assumes the mod_id to be a continuous range, and allocates memory according to that number. There are no checks on the mod_id, and as a result, we write to random memory. This may cause all kinds of issues.

So, we need to:

  1. validate mod_id in C
  2. prevent the generation of new mod_id for duplicate modifications. Either just warn and ignore, warn and update the existing entry, or raise an exception and stop further processing

Optionally, we can use this opportunity to support having the same modification name for multiple amino acids.

@paretje paretje added the bug label Apr 24, 2020
@paretje paretje self-assigned this Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant