I have the following function that takes a dictionary of SMILES strings and converts them to RDKit mol objects.
def smiles_dict_to_mol_list(smiles_dict):
"""smiles dict is a dictionary object containing molecule names
as keys and smiles strings as values.
The return value is a list of RDKit mol objects.
"""
smiles_as_mol = []
for mol_name, smiles_string in smiles_dict.items():
try:
mol = Chem.MolFromSmiles(smiles_string)
mol.SetProp("_Name", mol_name)
smiles_as_mol.append(mol)
except:
print("Error processing:", mol_name)
return smiles_as_mol
This function normally works very well and I can convert any SMILES into a mol object, but when I try to convert the below structure I get an exception. I believe that this is because this compound, and others that also give exceptions, have a coordinated metal ion. In this case platinum. It is also possible that the SMILES string I am using is the problem, but I don't know how I would tell the difference.
N2W: COc1cc(cc(c1O)OC)[C@@H]2c3cc4c(cc3[C@H]([C@@H]5[C@H]2C(=O)OC5)NC(=O)CC[C@@H]6C[NH2][Pt]([NH2]6)Cl)OCO4
So my question is: How can I change my RDKit code so I can work with compounds that have metal atoms?