MolScribe
MolScribe copied to clipboard
output smiles and molfile are different
For some images, molfile and smiles generated by MolScribe are different.
mol_prediction = model.predict_image_file(img_path, return_confidence=True)
Chem.MolFromMolBlock(mol_prediction['molfile']) == Chem.MolFromSmiles(mol_prediction['smiles'])
This returns False
Molfile has R-group attachment points, SMILES returns the molecule on the picture.
You can refer the code below,the pred_molblock is the mol without expanding funtional group (or abbression) in molblock to keep the consistent relative coordinates with original image and faciliating user to align, while pred_smiles is the new mol with expanding funtional group (or abbression) to evaluation the accurancy of prediction.
https://github.com/thomas0809/MolScribe/blob/main/molscribe/chemistry.py#L556-L567