Hi all,

I agree about the impractical task of fixing the task in more than a handful of 
files.
Besides, there's an intrinsic problem with fully supported file formats that do 
not have such information.

@David Koes: A week ago I posted about this issue: if you try reading a 
perfectly valid XYZ file (which has no charges) of ammonium with this command, 
you end up with a nitrogen with 5 bonds:

   obabel ammonium.xyz -ph 7 -O ammonium_xyz.mol2

@David van der Spoel: one thing I've noticed is that charged systems get 
properly recognized if you perform an intermediate conversion before 
manipulating the molecule. For the above issue, for example, it generates the 
proper protonated nitrogen:
obabel ammonium.xyz -O ammonium_xyz_step1.mol2
   obabel ammonium_xyz_step1.mol2 -ph 7  -O ammonium_xyz_step2.mol2

I've tried to figure out where the formal charge perception happens, but 
without success. Possibly doing so before the bond perception might help fixing 
your problem without having to extend the bondtyp.txt file? (but definitely not 
if the SMARTS pattern is missing).

S

On 5/13/21 12:52 PM, Ghahremanpour, Mohammad wrote:
Hi David,

Thanks for your reply.

It is practical to manually specify the formal charge of the atoms in the input 
file for a few compounds, the problem arises when you work with many compounds 
in different file formats. In this case, it would be good to have a backup 
plan. It seems that if the bond order of bonds and the formal charge of atoms 
are specified correctly, Kekulization works fine in most cases, if I am not 
mistaken.

It would definitely help to see what other people suggest before changing the 
source code or the format of data files. Any suggestion is highly appreciated.

Cheers,

Mohammad

On May 13, 2021, at 3:33 PM, David Koes <dk...@pitt.edu> wrote:

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


--

 Stefano Forli, PhD

 Associate Professor
 Dept. of Integrative Structural
 and Computational Biology, MB-112A
 Scripps Research
 10550  North Torrey Pines Road
 La Jolla,  CA 92037-1000,  USA.

    tel: +1 (858)784-2055
    email: fo...@scripps.edu
    https://forlilab.org

Attachment: ammonium.xyz
Description: Xmol XYZ data

_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to