Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defines super_parent_syn #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

None yet

1 participant