Hi Mohammad,
bondtyper.txt does not have any ability to set formal charges. If you
need to do something more sophisticated than matching with SMARTS to set
bond orders you need to modify the C++ code.
Whether what you are proposing is the right thing to do, I leave to
others to decide. I would typically assume that the formal charge
should be specified in the input file. Also, I'm not sure bondtyping is
the right place for Kekulization fixes.
David Koes
Associate Professor
Computational & Systems Biology
University of Pittsburgh
On 5/13/21 10:50 AM, Ghahremanpour, Mohammad wrote:
Hi David,
In order to make kekulization work on imidazolium rings, I hard coded
SMARTS in bondtyper.cpp, where I explicitly set the formal charge of one
of the nitrogens to 1 and also set the bond order to 2 for two of the
bonds in the ring. Doing this, kekulization works fine.
As pointed out by you, the SMARTS for bond typing should be defined in
bondtyp.txt data file not hardcoded in the source file. I did it but
kelulizataion fails again, as the result of which the imidazolium ring
is considered as AL instead of AR. I think the problem is the formal
charge which is set to 0 for all atoms by default. While, for rings like
imidazolium, the formal charge of the nitrogen with four bonds is 1.
In bondtyper.cpp, there are other examples were the formal charges are
set explicitly, oxido-n+ (e.g., pyridine-N-oxide).
I was wondering if there is some data file to tabulate formal charge for
specific cases like this. I checked atomtyp.txt, not formal charge is
stored there.
Thanks,
Mohammad
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel