Re: [Open Babel] Aromatic bonds

2018-08-29 Thread Don Kelsey
Since I didn't do the integration with OpenBabel, I'll have to check with the 
programmers perhaps they assumed they had to invoke SMILES.   Possible they 
didn't understand the programming needed for simply reading in and translating 
files  OR more likely, perhaps I suggested it would be nice to show benzene 
rings, for example,  with aromatic bonds so they decided to invoke SMILES 
because it would identify aromatic bonds.  In the latter case, added aromatic 
bond capability would have been likely over 3 years ago, so I don't recall the 
details.

The examples I showed only surfaced recently during my testing more unusual or 
theoretical reactions. 

Don

On Aug 29, 2018, at 8:06 PM, Geoffrey Hutchison  
wrote:

>> Thanks for comments.   When I print out files from Avogadro that we use for 
>> input to our program, the atoms are in a given sequence.  After going 
>> through OpenBabel,  the atom numbering and sequence is totally different 
>> from the files that were read as evidenced by the numbering that appears in 
>> our displays and the input files for the MO program.
> 
> I'm sorry, that's not possible unless you're modifying the molecule somehow 
> in "going through Open Babel." What exactly are you doing?
> 
>> Intuitively I would think SMILES might have to resequence atoms to get the 
>> most efficient description.  
> 
> Aha. What does SMILES have to do with what you want to do? Why don't you back 
> up and tell us what you're trying to do with Open Babel in your program? Yes, 
> SMILES may re-order atoms and remove hydrogens. But why does SMILES have 
> anything to do with "reading in a file and displaying some orbitals?"
> 
>> that ignoring the "Isaromatic" bonds should leave the 1, 2, 3 type bond 
>> information intact that our program will still be able to use.   Do I 
>> understand that correctly?
> 
> Yes.
> 
>> The reason we have included PDB files (which work fine from Avogadro) is 
>> that the Spartan ab initio program can generate such 3d files and their PDB 
>> files work ok.  Oddly, the MOL files generated by Spartan don't work.  We 
>> are trying to allow file types from other programs besides Avogadro that can 
>> generate 3d structure files.  
> 
> IIRC, Spartan produces decidedly non-standard files. Please feel free to open 
> a bug report and upload some "MOL" files from Spartan.
> 
> Best regards,
> -Geoff
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Aromatic bonds

2018-08-29 Thread Don Kelsey
Thanks for comments.   When I print out files from Avogadro that we use for 
input to our program, the atoms are in a given sequence.  After going through 
OpenBabel,  the atom numbering and sequence is totally different from the files 
that were read as evidenced by the numbering that appears in our displays and 
the input files for the MO program.  I don't think we're doing anything to 
reorder the atoms just to display.

For example, for a Cyclobutene, the Avogadro output has 4 carbons listed first 
than all the hydrogens because than is how it was drawn. Our display 
(after OpenBabel) then shows carbons are  #s 1, 4, 7, 9 instead of the original 
sequence 1, 2, 3, 4  --  the hydrogens are numbered so the first two (# 2  & 3) 
are attached to C-1, 5&6 to C-4 and so forth.  I can check that further --- 
although the resequencing is not really an issue for us.   Intuitively I would 
think SMILES might have to resequence atoms to get the most efficient 
description.  

I'm just saying what we observe.  Perhaps there is another explanation. 

Per Noel's note about Isaromatic , I realized after reading it that I may have 
made an assumption about how OpenBabel designates bond types.  I assumed 
aromatic is a distinct bond type (0, 1, 2, 3, aromatic) However, if we can 
ignore the "Isaromatic" bonds, I interpret that to indicate that OpenBabel 
designates a bond order (1, 2,3) between two atoms plus whether that bond is 
also aromatic.   If that is true, then it now becomes obvious (wasn't before) 
that ignoring the "Isaromatic" bonds should leave the 1, 2, 3 type bond 
information intact that our program will still be able to use.   Do I 
understand that correctly?

The reason we have included PDB files (which work fine from Avogadro) is that 
the Spartan ab initio program can generate such 3d files and their PDB files 
work ok.  Oddly, the MOL files generated by Spartan don't work.  We are trying 
to allow file types from other programs besides Avogadro that can generate 3d 
structure files.  

I appreciate your comment about aromaticity.  For the 
5,6-diaza-1,3-cyclohexadiene  [DACHD] case,there is a single bond between 
the Nitrogens (the N-Hs might be hard to see in my screenshots).  It is a 
dihydropyridazine  (C4H4N2 + H2  --> C4H6N2).  Since pyridazine is 
definitely(?) delocalized, difficult for me to see how the hydrogenated 
derivative could also be aromatic.  In any case, for our reactant/product 
analysis,  using aromatic bonds for DACHD doesn't work properly. 

Thanks to you both for suggestions.   I'm hoping either ignoring the Isaromatic 
bonds or using the development version will solve our issues.

Best regards, 

Don

On Aug 29, 2018, at 2:08 PM, Geoffrey Hutchison  
wrote:

>> Since OpenBabel is designating aromatic bonds, we have to go along with that 
>> for use in our program.  (If we knew the original bond -- from Avogadro 
>> input -- between the pertinent atoms, we could just use that info but 
>> OpenBabel rearranges the atom sequences - which we don't really need to 
>> have done, either!) 
> 
> There's absolutely no way that's happening. Sorry to sound so emphatic, but 
> Avogadro v1 directly uses Open Babel. Unless you're removing hydrogens, 
> there's never any atom reordering occurring inside the Open Babel code. And 
> if you're deleting hydrogens - you don't need to do that to depict 2D 
> diagrams, since they can ignore hydrogens themselves.
> 
>> I have attached 4 screen shots of our graphics showing examples of molecules 
>> where aromatic bonds (double dashed bonds) should not occur.  It appears the 
>> program thinks that the electron pairs on oxygen and nitrogen (also 
>> phosphorus) should be combined with the double bonds or aromatic ring to 
>> make delocalized "aromatic" structures.   The heteroatoms don't have to be 
>> adjacent (e.g. a similar case occurs with P in the 1,3 positions of the 
>> cyclobutane ring).   
> 
> If you get X chemists in a room, chances are that you'll have X+1 definitions 
> of "what is aromatic" after not too long. As Noel indicated, an aromaticity 
> model for cheminformatics (Daylight, previous Open Babel aromaticity models, 
> etc.) may not match your intuition.
> 
> If you have MOL and CML formats from Avogadro or other programs, these will 
> have 1, 2, 3 bond orders without aromaticity. You're done. PDB is a whole 
> different ball of wax and I'd suggest you avoid that format as much as you 
> can. 
> 
> Hope that helps,
> -Geoff
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Aromatic bonds

2018-08-29 Thread Geoffrey Hutchison
> Thanks for comments.   When I print out files from Avogadro that we use for 
> input to our program, the atoms are in a given sequence.  After going through 
> OpenBabel,  the atom numbering and sequence is totally different from the 
> files that were read as evidenced by the numbering that appears in our 
> displays and the input files for the MO program.

I'm sorry, that's not possible unless you're modifying the molecule somehow in 
"going through Open Babel." What exactly are you doing?

> Intuitively I would think SMILES might have to resequence atoms to get the 
> most efficient description.  

Aha. What does SMILES have to do with what you want to do? Why don't you back 
up and tell us what you're trying to do with Open Babel in your program? Yes, 
SMILES may re-order atoms and remove hydrogens. But why does SMILES have 
anything to do with "reading in a file and displaying some orbitals?"

> that ignoring the "Isaromatic" bonds should leave the 1, 2, 3 type bond 
> information intact that our program will still be able to use.   Do I 
> understand that correctly?

Yes.

> The reason we have included PDB files (which work fine from Avogadro) is that 
> the Spartan ab initio program can generate such 3d files and their PDB files 
> work ok.  Oddly, the MOL files generated by Spartan don't work.  We are 
> trying to allow file types from other programs besides Avogadro that can 
> generate 3d structure files.  

IIRC, Spartan produces decidedly non-standard files. Please feel free to open a 
bug report and upload some "MOL" files from Spartan.

Best regards,
-Geoff


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Aromatic bonds

2018-08-29 Thread Geoffrey Hutchison
> Since OpenBabel is designating aromatic bonds, we have to go along with that 
> for use in our program.  (If we knew the original bond -- from Avogadro input 
> -- between the pertinent atoms, we could just use that info but OpenBabel 
> rearranges the atom sequences - which we don't really need to have done, 
> either!) 

There's absolutely no way that's happening. Sorry to sound so emphatic, but 
Avogadro v1 directly uses Open Babel. Unless you're removing hydrogens, there's 
never any atom reordering occurring inside the Open Babel code. And if you're 
deleting hydrogens - you don't need to do that to depict 2D diagrams, since 
they can ignore hydrogens themselves.

> I have attached 4 screen shots of our graphics showing examples of molecules 
> where aromatic bonds (double dashed bonds) should not occur.  It appears the 
> program thinks that the electron pairs on oxygen and nitrogen (also 
> phosphorus) should be combined with the double bonds or aromatic ring to make 
> delocalized "aromatic" structures.   The heteroatoms don't have to be 
> adjacent (e.g. a similar case occurs with P in the 1,3 positions of the 
> cyclobutane ring).   

If you get X chemists in a room, chances are that you'll have X+1 definitions 
of "what is aromatic" after not too long. As Noel indicated, an aromaticity 
model for cheminformatics (Daylight, previous Open Babel aromaticity models, 
etc.) may not match your intuition.

If you have MOL and CML formats from Avogadro or other programs, these will 
have 1, 2, 3 bond orders without aromaticity. You're done. PDB is a whole 
different ball of wax and I'd suggest you avoid that format as much as you can. 

Hope that helps,
-Geoff
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Aromatic bonds

2018-08-29 Thread Noel O'Boyle
Looking at the first one, C1(=C)C(=C)NN1 has an aromatic ring according to
the Daylight aromaticity model. This is according to Open Babel but also
the CDK (and anyone else that implements it correctly). The atom
contributions are described at
https://figshare.com/articles/Daylight_Aromatic_Atoms/3370945

Since you say that Kekule structures are perfectly fine, then there is no
need to call IsAromatic() - just use the bond orders as provided. I forget
if this will work correctly with the released version, but it certainly
does with the development version.

Regards,
- Noel

On Wed, 29 Aug 2018 at 04:54, Don Kelsey  wrote:

> Hello,   Thanks to you both for your prompt reply.Perhaps I should
> mention that this project is a joint project between chemistry and computer
> science. I'm the "chemistry" guy and I'm working with a professor and
> students who are doing the actual programming.  My experience with
> programming is very long ago, so I'm a bit naive about some details.
>
> That being said, we are using OpenBabel to read MOL (MDL), PDB and CML
> formats generated by Avogadro (or other programs), which all have a bonding
> table with 1, 2, or 3 bond orders (no aromatic designations).
>
> We need the bond orders because we are displaying the molecules in
> rotatable  2D structures (I think we use OxyPlot) but also because we are
> comparing the bonding parameters between reactants and products, which is
> important.  With, say, benzene rings, the aromatic bonds that OpenBabel
> generates are OK.  But other structures, they create havoc.   I will attach
> examples.
>
> For reasons too lengthy to go into, when OpenBabel generates an improper
> aromatic bond, it not only creates errors in the display but also creates
> errors in our reactant/product comparison analysis.
>
> I'm reasonably sure it is OpenBabel that is changing the input bonding (0,
> 1, 2, 3)  between atom pairs to aromatic:  In our Folder "OpenBabel
> Integration", there is are three files, one of which for example has code:
> "if bond.Isaromatic
> bondType = BondType.Aromatic_Bond"
>
> where I'm pretty sure the "Isaromatic" comes from a term in OpenBabel and
> this code is just telling our program to then set the bond type as
> "Aromatic_Bond"  (which separately we also set as 1.5 bond order --- sorry,
> I might have confused you by mentioning this in my first note).
>
> Since OpenBabel is designating aromatic bonds, we have to go along with
> that for use in our program.  (If we knew the original bond -- from
> Avogadro input -- between the pertinent atoms, we could just use that info
> but OpenBabel rearranges the atom sequences - which we don't really
> need to have done, either!)
>
> Your suggestion that using the development version maybe very useful 
> I will have to ask the computer guys to see if they can use it so I can
> test to see if the errors go away.  Right now, I can't send examples using
> the release version  I have to defer to the computer guys to alter our
> program first.
>
> Another solution would be to prevent the release version OpenBabel from
> generating any aromatic bonds and, in fact, they really aren't necessary
> --- Kekule structures are perfectly fine for our program.
>
> In case it is useful for correcting the release version,
> I have attached 4 screen shots of our graphics showing examples of
> molecules where aromatic bonds (double dashed bonds) should not occur.  It
> appears the program thinks that the electron pairs on oxygen and nitrogen
> (also phosphorus) should be combined with the double bonds or aromatic ring
> to make delocalized "aromatic" structures.   The heteroatoms don't have to
> be adjacent (e.g. a similar case occurs with P in the 1,3 positions of the
> cyclobutane ring).
> I would guess it may happen with sulphur, too.  It doesn't happen with C
> or Si (at least neutral).  I haven't found an example with B or Al but that
> doesn't mean it might occur.
>
> Other than trying the development version, do you have any other
> suggestions of possible solutions or work arounds?Solving this is
> important to us since there are potentially many reactions of interest
> where inappropriate aromatic bonds ruin our analyses.
>
> Thanks much for your help,
>
> Don
>
> On 8/24/2018 9:11 AM, Noel O'Boyle wrote:
>
> I would just add that while there are known problems with aromatic SMILES
> written by the release version, I'm not aware of any problems with the
> development version. Those SMILES should be read without any trouble by any
> other toolkit.
>
> Could you give a specific example as Geoff says, but using the development
> version. Internally, we don't have bond order 1.5 or even "aromatic bonds".
> Every bond has a discrete bond order; but in addition to this, the aromatic
> model may mark some bonds as aromatic.
>
> Regards,
> - Noel
>
>
> On Fri, 24 Aug 2018 at 08:45, Geoffrey Hutchison <
> geoff.hutchi...@gmail.com> wrote:
>
>> > An issue is that for some molecules, 

Re: [Open Babel] Aromatic bonds

2018-08-24 Thread Noel O'Boyle
I would just add that while there are known problems with aromatic SMILES
written by the release version, I'm not aware of any problems with the
development version. Those SMILES should be read without any trouble by any
other toolkit.

Could you give a specific example as Geoff says, but using the development
version. Internally, we don't have bond order 1.5 or even "aromatic bonds".
Every bond has a discrete bond order; but in addition to this, the aromatic
model may mark some bonds as aromatic.

Regards,
- Noel


On Fri, 24 Aug 2018 at 08:45, Geoffrey Hutchison 
wrote:

> > An issue is that for some molecules, the translation process introduces
> improper aromatic (delocalized) bonds (e.g. Bond Oder 1.5).For our use,
> we don't need display of aromatic bonds nor for input into the MO program
> (which needs only xyz coordinates).
>
> Well, I'm obviously curious to know your examples where the aromatic bonds
> are "improper" but I'd point out that the issue is the "display" there.
> Usually most programs let you turn off display of multiple bonds. So my
> question would be what program you're using for display.
>
> Moreover, if you're only using XYZ coordinates - the bonds are irrelevant.
>
> Perhaps you could tell us more about your workflow? How are you getting
> your 3D molecular structure files, what are you using to display, and what
> files give you the problem?
>
> Thanks,
> -Geoff
>
> ---
> Prof. Geoffrey Hutchison
> Department of Chemistry
> University of Pittsburgh
> tel: (412) 648-0492
> email: geo...@pitt.edu
> twitter: @ghutchis
> web: https://hutchison.chem.pitt.edu/
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Aromatic bonds

2018-08-24 Thread Geoffrey Hutchison
> An issue is that for some molecules, the translation process introduces 
> improper aromatic (delocalized) bonds (e.g. Bond Oder 1.5).For our use, 
> we don't need display of aromatic bonds nor for input into the MO program 
> (which needs only xyz coordinates).

Well, I'm obviously curious to know your examples where the aromatic bonds are 
"improper" but I'd point out that the issue is the "display" there. Usually 
most programs let you turn off display of multiple bonds. So my question would 
be what program you're using for display.

Moreover, if you're only using XYZ coordinates - the bonds are irrelevant.

Perhaps you could tell us more about your workflow? How are you getting your 3D 
molecular structure files, what are you using to display, and what files give 
you the problem?

Thanks,
-Geoff

---
Prof. Geoffrey Hutchison
Department of Chemistry
University of Pittsburgh
tel: (412) 648-0492
email: geo...@pitt.edu
twitter: @ghutchis
web: https://hutchison.chem.pitt.edu/
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss