2
$\begingroup$

Hi I am using moleculeRecognize function to upload structures from images and I am attempting to convert the structures in .mol files. However every time I convert to .mol files the hydrogen atoms in the structures are not being accounted for. I was wondering if anyone has any way to overcome this.

$\endgroup$
1
  • 3
    $\begingroup$ Could you please include a sample image and the exact code you use? Paste the code in your question as text. $\endgroup$
    – MarcoB
    Commented Feb 9, 2022 at 21:31

1 Answer 1

4
$\begingroup$

Try this. Start with a suitable image. For example,

img = Image@MoleculePlot@Import@First@
      FileNames["aspirin.mol", $InstallationDirectory, 6];
Show[img, ImageSize -> Small]

enter image description here

Now, apply MoleculeRecognize to the image and export the results as a .mol file with the IncludeHydrogens option, like this

Export["tmp.mol", MoleculeRecognize[img],
  "MOL", IncludeHydrogens -> True];
Import[%, "Text"]

enter image description here

There is more to the .mol file than is shown above. Notice the 7 hydrogens at the end of the atom list.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.