In an attempt to bind an ion to histidine using custom groups, I encountered an unexpected issue.
from rdkit import Chem
from rdkit.Chem import AllChem
from group_selfies import (
fragment_mols,
Group,
MolecularGraph,
GroupGrammar,
group_encoder
)
from rdkit.Chem.Draw import IPythonConsole
from IPython.display import display
from test_utils import *
from rdkit import RDLogger
RDLogger.DisableLog('rdApp.*')
g = Group('ion', 'CCCCCCCCCCCCS(=O)(=O)(*1)') # create the ion group
amino = Group("histidine", "O=C([C@H](CC1=CN(*1)C=N1)N)O") # create the histidine group
grammar = GroupGrammar([g, amino])
new_selfies = "[:0histidine][:0ion]"
display(grammar.decoder(new_selfies)) # This may be a silent error and just displays histidine
new_selfies = "[:0histidine][:0ion][:0ion][:0histidine]"
display(grammar.decoder(new_selfies)) # This displays the desired molecule.
In an attempt to bind an ion to histidine using custom groups, I encountered an unexpected issue.