Repository navigation
Rework smiles parsing in alphabase - #460
lucas-diedrich wants to merge 2 commits into
Conversation
|
Summary of a design discussion and prototype on branch 1. Purpose of the modules
2. Current approachLogical flowFormat: superheavy elements as placeholders for join points.
Applying an N-terminal modification (
Applying a C-terminal modification: Building a peptide (
Issues
3. New approachRDKit concepts that simplify itThe rework uses hardly any new RDKit API; the old code already used
Rejected alternatives:
Reactions remain an option if the team prefers not to own the stereo logic. The table format can stay as it is, because each mod SMILES can be turned into a reaction automatically. New formatEvery entry is a complete, valid molecule. Its join points carry atom-map numbers:
New flowOne operation,
Everything is built from this one operation:
Example, acetyl-alanine: Prototype state (draft PR on
|
Prompts
|
Reviewing #457, I noticed that the logic in the same
smiles.pymodule got reworked for the ~third time within a few releases. I believe that this is probably indicative that the current approach has some limitationsI wanted to quickly explore some alternatives.
This PR is fully vibed and is not meant to be merged but to start the discussion whether it makes sense to refactor the module. I think as a proof of principle it revealed some nice properties:
Overall, this makes the merging of molecular subgraphs generalizable, i.e. one function (
merge_at_anchors) can handle the connection of Modification-N terminus, Modification-C terminus, or residue-residue; and each modification inmodification.tsvis a valid molecule on its own.On this PR
The next comment summarizes my conversation with Claude and gives more technical details on the implementation of the old and new approach.
For reviewers, I would suggest to look at:
smiles.py: Major changes to logic, move to RDKit logic. Slight reduction in LOCpeptide.py: Highest impact, reduces the required custom logic the mostadding_smiles.py: See the diff to get an intuition for the changes to the SMILES stringsThe rest is just to have an end-to-end solution