feat: add lactyl and formyl modifications with SMILES#384
Merged
Conversation
- Add Lactyl@K, Lactyl@Any_N-term, Lactyl@Protein_N-term modifications - Add SMILES for Formyl@K, Formyl@Any_N-term, Formyl@Protein_N-term - Add msfragger mappings for lactyl and formyl modifications - Add dimethyl modifications to msfragger default mod list 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add YnLactyl@K, YnLactyl@Any_N-term, YnLactyl@Protein_N-term (click chemistry probe) - Fix Lactyl SMILES to use correct L-lactic acid stereochemistry ([C@@h]) - Add msfragger mappings for YnLactyl 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When multiple modifications have similar masses within tolerance, return the one with the closest mass match instead of the first one. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove dead code branch for X/Any mod sites and reduce nesting with early continue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for lactyl and formyl post-translational modifications, along with their SMILES representations, to enable their detection and analysis in mass spectrometry data.
- Adds Lactyl and YnLactyl modifications for K, Any_N-term, and Protein_N-term sites with SMILES structures
- Adds SMILES representations for existing Formyl modifications (K, Any_N-term, Protein_N-term)
- Updates MSFragger modification mappings and default mass-mapped modification list to include lactyl, formyl, and dimethyl variants
- Refactors mass matching logic to select the closest mass match when multiple modifications fall within tolerance
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| alphabase/constants/const_files/modification.tsv | Adds SMILES structures for Lactyl, YnLactyl, and Formyl modifications at K and N-terminal positions |
| alphabase/constants/const_files/psm_reader.yaml | Adds MSFragger modification mappings for Lactyl, YnLactyl, and Formyl, and expands default mass-mapped modifications list |
| alphabase/psm_reader/msfragger_reader.py | Refactors _match_mod_by_mass to find closest mass match instead of first match within tolerance |
| tests/unit/psm_reader/test_msfragger_modification_translation.py | Adds test coverage for closest mass matching behavior with Formyl and Dimethyl modifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
I had to fix a bug where any modification was matched by mass and not the closest |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
lucas-diedrich
approved these changes
Jan 5, 2026
Collaborator
Author
|
This is really annoying, It cant be expected, that the reviewer has to compare the masses. I will write a test for this. |
Add test to verify all MSFragger modification masses in psm_reader.yaml are truncated (not rounded) to exactly 4 decimal places. Fixed masses: - Dimethyl:2H(6)13C(2)@K/Any_N-term: 36.0757 -> 36.0756 - YnLactyl@K/Any_N-term: 239.1270 -> 239.1269 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #380 (add-dimethyl)
🤖 Generated with Claude Code