Skip to content

Conversation

@gjgetzinger
Copy link

During compound standardization/registration, it can be helpful to preserve molecule identifiers for mapping synonyms or related molecules. This function mirrors the super_parent function, but captures InChI identifiers at each sanitization step and assigns them as properties of the sanitized molecule (either InChI or InChI Key).

smi = '[13CH3][C@@H](C)C/C=C([O-])\O.[Na+]'
mol = Chem.MolFromSmiles(smi)
mol_san = super_parent_syn(mol, 'inchikey')
mol_san.GetPropsAsDict()
{'fragment_inchikey': 'GCBSTXJCFNXFGB-DQIXCRJTSA-M', 'charge_inchikey': 'VBJZLOGJBQCFRJ-BBAZYXFWSA-M', 'isotope_inchikey': 'VBJZLOGJBQCFRJ-BBAZYXFWSA-N', 'stereo_inchikey': 'VBJZLOGJBQCFRJ-UHFFFAOYSA-N', 'tautomer_inchikey': 'VBJZLOGJBQCFRJ-UHFFFAOYSA-N', 'standardize_inchikey': 'FGKJLKRYENPLQH-UHFFFAOYSA-N', 'inchikey': 'FGKJLKRYENPLQH-UHFFFAOYSA-N'}

During compound standardization/registration, it can be helpful to preserve molecule identifiers for mapping synonyms or related molecules. This function mirrors the `super_parent` function, but captures InChI identifiers at each sanitization step and assigns them as properties of the sanitized molecule (either InChI or InChI Key). 

```python 
smi = '[13CH3][C@@h](C)C/C=C([O-])\O.[Na+]'
mol = Chem.MolFromSmiles(smi)
mol_san = super_parent_syn(mol, 'inchikey')
mol_san.GetPropsAsDict()
```

```
{'fragment_inchikey': 'GCBSTXJCFNXFGB-DQIXCRJTSA-M', 'charge_inchikey': 'VBJZLOGJBQCFRJ-BBAZYXFWSA-M', 'isotope_inchikey': 'VBJZLOGJBQCFRJ-BBAZYXFWSA-N', 'stereo_inchikey': 'VBJZLOGJBQCFRJ-UHFFFAOYSA-N', 'tautomer_inchikey': 'VBJZLOGJBQCFRJ-UHFFFAOYSA-N', 'standardize_inchikey': 'FGKJLKRYENPLQH-UHFFFAOYSA-N', 'inchikey': 'FGKJLKRYENPLQH-UHFFFAOYSA-N'}
```
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