Skip to content

add molecule parsing functionality - #18

Merged
sfluegel05 merged 5 commits into
devfrom
feature/molecule-parsing
Aug 3, 2026
Merged

add molecule parsing functionality#18
sfluegel05 merged 5 commits into
devfrom
feature/molecule-parsing

Conversation

@sfluegel05

@sfluegel05 sfluegel05 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

As noticed in ChEB-AI/python-chebai-graph#40, the SMILES parsing across different workflows is not consistent. While chebi_utils provides a sanitation function and a molblock parser, during inference, SMILES (or InCHI) strings can be used as input.

To standardize SMILES / InChI parsing across different repositories, I added a smiles_or_inchi_to_mol function.

The new SMILES / InChI / Molblock processing works as follows:

  • Try to parse with the RDKit function (Chem.MolFrom*, sanitize=False, removeHs=False)
  • If that yields None, return None with a warning
  • Otherwise sanitize and return
  • Sanitization tries to apply the update_mol_valences and Chem.SanitizeMol functions
  • If that fails, it instead applies UpdatePropertyCache and FindFastRings to get the minimum properties needed for GNN processing

@sfluegel05
sfluegel05 merged commit 9f9755b into dev Aug 3, 2026
8 checks passed
@sfluegel05
sfluegel05 deleted the feature/molecule-parsing branch August 3, 2026 13:09
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.

1 participant