Skip to content

feat: add lactyl and formyl modifications with SMILES#384

Merged
GeorgWa merged 8 commits intomainfrom
lactyl-formyl
Jan 5, 2026
Merged

feat: add lactyl and formyl modifications with SMILES#384
GeorgWa merged 8 commits intomainfrom
lactyl-formyl

Conversation

@GeorgWa
Copy link
Copy Markdown
Collaborator

@GeorgWa GeorgWa commented Jan 3, 2026

Summary

  • Add Lactyl@K, Lactyl@Any_N-term, Lactyl@Protein_N-term modifications with SMILES
  • 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

Stacked on #380 (add-dimethyl)

🤖 Generated with Claude Code

GeorgWa and others added 2 commits January 3, 2026 19:36
- 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>
Base automatically changed from add-dimethyl to main January 4, 2026 11:07
GeorgWa and others added 4 commits January 4, 2026 12:08
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>
@GeorgWa GeorgWa requested review from Copilot, lucas-diedrich and mschwoer and removed request for Copilot and mschwoer January 4, 2026 11:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread alphabase/psm_reader/msfragger_reader.py
@GeorgWa
Copy link
Copy Markdown
Collaborator Author

GeorgWa commented Jan 4, 2026

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>
Copy link
Copy Markdown
Collaborator

@lucas-diedrich lucas-diedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread alphabase/constants/const_files/psm_reader.yaml
@GeorgWa
Copy link
Copy Markdown
Collaborator Author

GeorgWa commented Jan 5, 2026

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>
@GeorgWa GeorgWa merged commit cfca8d1 into main Jan 5, 2026
3 checks passed
@GeorgWa GeorgWa deleted the lactyl-formyl branch January 5, 2026 22:28
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 this pull request may close these issues.

3 participants