MolScribe icon indicating copy to clipboard operation
MolScribe copied to clipboard

output smiles and molfile are different

Open nbosc opened this issue 1 year ago • 1 comments

For some images, molfile and smiles generated by MolScribe are different.

Image

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.

nbosc avatar Mar 07 '25 14:03 nbosc

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

LingjieBao1998 avatar Mar 07 '25 16:03 LingjieBao1998