Augus1999 / mol2chemfigPy3

The python 3 version of mol2chemfig package. 🛠️pip install mol2chemfigPy3
https://augus1999.github.io/mol2chemfigPy3/
MIT License
23 stars 3 forks source link

Issue with Parsing Pyridine-containing Structures Resulting in "Failed..." #4

Closed W-Geong closed 1 month ago

W-Geong commented 2 months ago

Hi there,

This repo has been a great help to me. Thank you very much for your contributions. While using it, I've found that for some specific structures, the parsing result outputs Failed.... Based on my observation, this seems to be caused by cases where a carbon atom in the benzene ring is replaced by a nitrogen atom (i.e., pyridine), such as in N#Cc1cnc(cn1)Oc1ccc(cc1Cl)F, ONC(=O)CCC(Cc1ccnc(c1)c1ccc(cc1)O)CCCNC(=O)c1ccccc1, and CCN(c1ccccc1C)C(=O)c1ccc(nn1)n1cncn1, among others.

Is there a way to fix this issue? I would also appreciate any suggestions for possible modifications.

Augus1999 commented 2 months ago

Sorry for the late response.

This issue occurs because epam.indigo package does not know how to deal with aromatic nitrogen in some cases. Using flag -r can bypass it. For example, in command line

$  mol2chemfig -zwo -r -i direct "N#Cc1cnc(cn1)Oc1ccc(cc1Cl)F"

or in a script

from mol2chemfigPy3 import mol2chemfig

mol2chemfig("N#Cc1cnc(cn1)Oc1ccc(cc1Cl)F", "-r")