reymond-group / smilesDrawer

A small, highly performant JavaScript component for parsing and drawing SMILES strings. Released under the MIT license.
https://smilesdrawer.rocks
MIT License
434 stars 67 forks source link

Implicit hydrogens are added to nitrogens in aromatic rings #70

Open dbryanbio opened 6 years ago

dbryanbio commented 6 years ago

Hi there, We love the look of SmilesDrawer, but this is a showstopper for us!

In the following SMILES string (NGI ligand from PDB case 4UHR), implicit hydrogens are erroneously added to nitrogens in aromatic rings: CCNC(=O)[C@H]1O[C@@H](n2c3nc(NCCc4ccc(CC[C@@H](O)[O-])cc4)nc(N)c3nc2)[C@H](O)[C@@H]1O Please see screenshots comparing the output with different tools: SmilesDrawer: http://doc.gdb.tools/smilesDrawer/sd/example/index.html nitrogens_failing_smilesdrawer MarvinJS: nitrogens_success_marvinjs ChemDoodle: nitrogens_success_chemdoodle Maestro: nitrogens_success_maestro

Hydrogens have been added to the success cases to demonstrate that the ring hydrogens are not still visible.

dbryanbio commented 6 years ago

Hmm, this is actually addressed by adding brackets to the affected nitrogens:

CCNC(=O)[C@H]1O[C@@H](n2c3[n]c(NCCc4ccc(CC[C@@H](O)[O-])cc4)[n]c(N)c3[n]c2)[C@H](O)[C@@H]1O

Let me check this over and update. Sorry for the confusion.

dbryanbio commented 6 years ago

Ok, while we might be able to work around this issue, we're standing by the bug report!
Here are simpler Aromatic nitrogen cases that fail: (have to be lowercase ns to be considered failing) c1cccnn1 pyridazine c1ncnc2[nH]cnc12 purine n1cc2nccnc2nc1 pteridine c1cc2cnncc2cc1 phthalazine

Screenshots comparing SmilesDrawer, Marvin, Maestro and ChemDoodle: c1cccnn1 pyridazine pyridazine

c1ncnc2[nH]cnc12 purine purine

n1cc2nccnc2nc1 pteridine pteridine

c1cc2cnncc2cc1 phthalazine phthalazine

daenuprobst commented 6 years ago

In the latest release (1.0.9) this specific problem is fixed. However, it comes (currently) with the cost, that hydrogens are removed from all aromatic nitrogens (defined with a lowercase n in SMILES).

We are working on a kukalization routine which should be introduced this summer.

azofeifa commented 1 year ago

Hello! In general, love this package, but this is still a problem for me. I have tried loading all the different versions (latest, 2.0.1, & 1.0.9) and this protonation of nitrogenes is still popping up. Do you still see this issue on your end?