Created
October 24, 2019 17:17
-
-
Save goraj/879b58dce21c971e35afdd360aefe5f9 to your computer and use it in GitHub Desktop.
rdkit_iron.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rdkit import Chem | |
from rdkit.Chem.MolStandardize import rdMolStandardize | |
# works | |
smiles_charged = '[CH2-][Fe++][CH2-]' | |
# does not work | |
smiles_charged = 'CCCC(=O)c1ccc[c-]1[Fe++][c-]1cccc1C(=O)CCC' | |
smiles_charged = 'Cc1ccc(C(=O)C=Cc2ccc[c-]2[Fe++][c-]2cccc2)c(O)c1' | |
print(f'smiles_uncharged: {smiles_charged}') | |
mol = Chem.MolFromSmiles(smiles_charged) | |
uncharger = rdMolStandardize.Uncharger() | |
mol_uncharged = uncharger.uncharge(mol) | |
smiles_uncharged = Chem.MolToSmiles(mol_uncharged) | |
print(f'smiles_uncharged: {smiles_uncharged}') | |
assert Chem.MolFromSmiles(smiles_uncharged) != None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment