Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread David Koes
That sounds great. I for one will never complain about inconveniences induced by adding additional testing.  You should 
be able to gzip the files and read the gz version directly with obabel to save on space.



David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/8/21 11:50 AM, David van der Spoel wrote:


We have a script that reads a Gaussian file and a reference sdf file and
compares whether the double bonds are in the same place and whether
generated atom types for the GAFF force field are the same. It uses the
openbabel python interface such as to keep everything in memory and not
create a ton of temporary files or tedious parsing of stdout. Would that
be an option? The crux is then that we need to add largish Gaussian
output files to the repository.



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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread David van der Spoel

On 2021-06-08 17:37, David Koes wrote:

If all the issues manifest themselves with calls to obabel, I would
add functions to test/testbabel.py (the filename is a throwback to
when obabel was babel).  You can see an example in this pull request:
https://github.com/openbabel/openbabel/pull/2379

Or, if you are feeling adventurous, I think it would be great if we
had a plain text file of obabel commands that are run with the
expected outputs following some standard naming convention. For
example, maybe each line is of the form:
  # files/correct_output
and the test function compares the standard out of running the command
to the correct_output file.
This would make it much easier to add tests if it is appropriate to
compare file outputs exactly.


We have a script that reads a Gaussian file and a reference sdf file and
compares whether the double bonds are in the same place and whether
generated atom types for the GAFF force field are the same. It uses the
openbabel python interface such as to keep everything in memory and not
create a ton of temporary files or tedious parsing of stdout. Would that
be an option? The crux is then that we need to add largish Gaussian
output files to the repository.




Thanks,

David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/8/21 11:22 AM, David van der Spoel wrote:

On 2021-06-08 15:42, David Koes wrote:

Hi Madeleine,

It sounds like you have a really excellent set of test structures.  It
would be fantastic if you could contribute these to the testing
framework.


We would be happy to do that, but maybe you can give a suggestion on
where in the testing framework? Or should we just add a new python
script there with in and output data?

FYI, we have made quite a few fixes already that likely are of interest
to others:
  % git diff master:data/bondtyp.txt data/bondtyp.txt | wc
  128 7844532



--
David van der Spoel, Ph.D.,
Professor of Computational Molecular Biophysics
Uppsala University.
http://virtualchemistry.org









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
http://www.uu.se/en/about-uu/data-protection-policy


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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread David Koes
If all the issues manifest themselves with calls to obabel, I would add functions to test/testbabel.py (the filename is 
a throwback to when obabel was babel).  You can see an example in this pull request:

https://github.com/openbabel/openbabel/pull/2379

Or, if you are feeling adventurous, I think it would be great if we had a plain text file of obabel commands that are 
run with the expected outputs following some standard naming convention. For example, maybe each line is of the form:

  # files/correct_output
and the test function compares the standard out of running the command to the 
correct_output file.
This would make it much easier to add tests if it is appropriate to compare 
file outputs exactly.

Thanks,

David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/8/21 11:22 AM, David van der Spoel wrote:

On 2021-06-08 15:42, David Koes wrote:

Hi Madeleine,

It sounds like you have a really excellent set of test structures.  It
would be fantastic if you could contribute these to the testing
framework.


We would be happy to do that, but maybe you can give a suggestion on
where in the testing framework? Or should we just add a new python
script there with in and output data?

FYI, we have made quite a few fixes already that likely are of interest
to others:
  % git diff master:data/bondtyp.txt data/bondtyp.txt | wc
  128 784    4532



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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread David van der Spoel

On 2021-06-08 15:42, David Koes wrote:

Hi Madeleine,

It sounds like you have a really excellent set of test structures.  It
would be fantastic if you could contribute these to the testing
framework.


We would be happy to do that, but maybe you can give a suggestion on
where in the testing framework? Or should we just add a new python
script there with in and output data?

FYI, we have made quite a few fixes already that likely are of interest
to others:
 % git diff master:data/bondtyp.txt data/bondtyp.txt | wc
 128 7844532





David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/8/21 8:15 AM, Marie-Madeleine Walz wrote:

Hi David,

thank you for your advice regarding using AssignTotalChargeToAtoms.
Adding it resulted in less errors in the bond order assignment.
Unfortunately, it did not remove e.g. the error with sulfite (SO3^2-)
that is still getting three double bonds.

Another issue is that some of the small rings (e.g. thiirene, C2H2S)
are not recognised as rings.
This is really confusing as the coordinates fullfil the requirement
set in mol.cpp, ConnectTheDots(), lines 3027-3028:

// bonded if closer than elemental Rcov + tolerance
 cutoff = SQUARE(rad[j] + rad[k] + 0.45);

If you have any advice I would really appreciate it.

With kind regards,
Madeleine



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



--
David van der Spoel, Ph.D.,
Professor of Computational Molecular Biophysics
Uppsala University.
http://virtualchemistry.org









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
http://www.uu.se/en/about-uu/data-protection-policy


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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread David Koes

Hi Madeleine,

It sounds like you have a really excellent set of test structures.  It would be fantastic if you could contribute these 
to the testing framework.


David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/8/21 8:15 AM, Marie-Madeleine Walz wrote:

Hi David,

thank you for your advice regarding using AssignTotalChargeToAtoms. Adding it 
resulted in less errors in the bond order assignment.
Unfortunately, it did not remove e.g. the error with sulfite (SO3^2-) that is 
still getting three double bonds.

Another issue is that some of the small rings (e.g. thiirene, C2H2S) are not 
recognised as rings.
This is really confusing as the coordinates fullfil the requirement set in 
mol.cpp, ConnectTheDots(), lines 3027-3028:

// bonded if closer than elemental Rcov + tolerance
 cutoff = SQUARE(rad[j] + rad[k] + 0.45);

If you have any advice I would really appreciate it.

With kind regards,
Madeleine



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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread Ghahremanpour, Mohammad
Hi Madeleine,

There is also a data file for ring types. That might help you fix the problem 
with small rings. 

openbabel/data/ringtyp.txt 

Best,

Mohammad

> On Jun 8, 2021, at 8:15 AM, Marie-Madeleine Walz 
>  wrote:
> 
> Hi David,
> 
> thank you for your advice regarding using AssignTotalChargeToAtoms. Adding it 
> resulted in less errors in the bond order assignment.
> Unfortunately, it did not remove e.g. the error with sulfite (SO3^2-) that is 
> still getting three double bonds.
> 
> Another issue is that some of the small rings (e.g. thiirene, C2H2S) are not 
> recognised as rings.
> This is really confusing as the coordinates fullfil the requirement set in 
> mol.cpp, ConnectTheDots(), lines 3027-3028:
> 
> // bonded if closer than elemental Rcov + tolerance
>cutoff = SQUARE(rad[j] + rad[k] + 0.45);
> 
> If you have any advice I would really appreciate it.
> 
> With kind regards,
> Madeleine
> 
>> On 7 Jun 2021, at 15:34, David Koes  wrote:
>> 
>> There is AssignTotalChargeToAtoms which is called when parsing the gamess 
>> format, but not, apparently, gaussian.
>> 
>> Again, if you could upload examples of failures to a GitHub Issue (or even 
>> better, start a pull request with failing tests added to the testing 
>> framework) that would be helpful.
>> 
>> David Koes
>> 
>> Associate Professor
>> Computational & Systems Biology
>> University of Pittsburgh
>> 
>> On 6/7/21 8:22 AM, Marie-Madeleine Walz wrote:
>>> Hi David,
>>> thank you for your reply. I tested your code that assigns a sp2 
>>> hybridisation to a N as e.g. in azete (in mol.cpp), and it solves the 
>>> incorrect bond orders.
>>> However, I think that this is a general problem: I have numerous compounds 
>>> that get incorrect bond orders and that end up with a different charge than 
>>> specified in the Gaussian output file (like e.g. sulfite and sulfur 
>>> trioxide). I think it might be a good idea to have somewhere a general 
>>> "charge check”. (Maybe there is and I miss to use it? I checked whether OB 
>>> is getting the specified charge and it seems to get it.)
>>> For example, it would be great if there is a function that checks (i) the 
>>> charge of the compound (or whether it is a radical) and (ii) the sum of 
>>> bond orders to a certain atom (I guess that is done with 
>>> GetExplicitValence()). If a compound is neutral (and not a radical) and 
>>> ends up with e.g. a C that only has three single bonds, this should be 
>>> somehow corrected.
>>> Is there any way to do this with the existing OB functions, i.e. without 
>>> changing the code?
>>> With kind regards,
>>> Madeleine
> 
> 
> 
> 
> 
> 
> 
> 
> 
> När du har kontakt med oss på Uppsala universitet med e-post så innebär det 
> att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan 
> du läsa här: 
> https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.uu.se%2Fom-uu%2Fdataskydd-personuppgifter%2Fdata=04%7C01%7Cmohammad.ghahremanpour%40yale.edu%7C3800a155cf7140cbbe9408d92a772244%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637587513460790622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=unIJsWaCXbAz%2B0gRtvO25UCDGA6naxS8vigP3EEaaQw%3Dreserved=0
>  
> 
> 
> E-mailing Uppsala University means that we will process your personal data. 
> For more information on how this is performed, please read here: 
> https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.uu.se%2Fen%2Fabout-uu%2Fdata-protection-policydata=04%7C01%7Cmohammad.ghahremanpour%40yale.edu%7C3800a155cf7140cbbe9408d92a772244%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637587513460790622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Z2wEGiSarBatMRVsJniKLg6O23SWykeotgK0o7qt604%3Dreserved=0
>  
> 
> 
> ___
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net 
> 
> 

Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread Marie-Madeleine Walz
Hi Mohammad,

thank you for your advice! I will have a look at that file.

With kind regards,
Madeleine

On 8 Jun 2021, at 14:34, Ghahremanpour, Mohammad 
mailto:mohammad.ghahremanp...@yale.edu>> wrote:

Hi Madeleine,

There is also a data file for ring types. That might help you fix the problem 
with small rings.

openbabel/data/ringtyp.txt

Best,

Mohammad

On Jun 8, 2021, at 8:15 AM, Marie-Madeleine Walz 
mailto:marie-madeleine.w...@icm.uu.se>> wrote:

Hi David,

thank you for your advice regarding using AssignTotalChargeToAtoms. Adding it 
resulted in less errors in the bond order assignment.
Unfortunately, it did not remove e.g. the error with sulfite (SO3^2-) that is 
still getting three double bonds.

Another issue is that some of the small rings (e.g. thiirene, C2H2S) are not 
recognised as rings.
This is really confusing as the coordinates fullfil the requirement set in 
mol.cpp, ConnectTheDots(), lines 3027-3028:

// bonded if closer than elemental Rcov + tolerance
   cutoff = SQUARE(rad[j] + rad[k] + 0.45);

If you have any advice I would really appreciate it.

With kind regards,
Madeleine

On 7 Jun 2021, at 15:34, David Koes mailto:dk...@pitt.edu>> 
wrote:

There is AssignTotalChargeToAtoms which is called when parsing the gamess 
format, but not, apparently, gaussian.

Again, if you could upload examples of failures to a GitHub Issue (or even 
better, start a pull request with failing tests added to the testing framework) 
that would be helpful.

David Koes

Associate Professor
Computational & Systems Biology
University of Pittsburgh

On 6/7/21 8:22 AM, Marie-Madeleine Walz wrote:
Hi David,
thank you for your reply. I tested your code that assigns a sp2 hybridisation 
to a N as e.g. in azete (in mol.cpp), and it solves the incorrect bond orders.
However, I think that this is a general problem: I have numerous compounds that 
get incorrect bond orders and that end up with a different charge than 
specified in the Gaussian output file (like e.g. sulfite and sulfur trioxide). 
I think it might be a good idea to have somewhere a general "charge check”. 
(Maybe there is and I miss to use it? I checked whether OB is getting the 
specified charge and it seems to get it.)
For example, it would be great if there is a function that checks (i) the 
charge of the compound (or whether it is a radical) and (ii) the sum of bond 
orders to a certain atom (I guess that is done with GetExplicitValence()). If a 
compound is neutral (and not a radical) and ends up with e.g. a C that only has 
three single bonds, this should be somehow corrected.
Is there any way to do this with the existing OB functions, i.e. without 
changing the code?
With kind regards,
Madeleine









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: 
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.uu.se%2Fom-uu%2Fdataskydd-personuppgifter%2Fdata=04%7C01%7Cmohammad.ghahremanpour%40yale.edu%7C3800a155cf7140cbbe9408d92a772244%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637587513460790622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=unIJsWaCXbAz%2B0gRtvO25UCDGA6naxS8vigP3EEaaQw%3Dreserved=0

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.uu.se%2Fen%2Fabout-uu%2Fdata-protection-policydata=04%7C01%7Cmohammad.ghahremanpour%40yale.edu%7C3800a155cf7140cbbe9408d92a772244%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637587513460790622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Z2wEGiSarBatMRVsJniKLg6O23SWykeotgK0o7qt604%3Dreserved=0

___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fopenbabel-develdata=04%7C01%7Cmohammad.ghahremanpour%40yale.edu%7C3800a155cf7140cbbe9408d92a772244%7Cdd8cbebb21394df8b4114e3e87abeb5c%7C0%7C0%7C637587513460790622%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=rJNJ1K5VEHB5LyW8Wu6h2jabAoyhLWaLLdLA%2F7Iv8JE%3Dreserved=0

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


Re: [OpenBabel-Devel] charge for bond order perception

2021-06-08 Thread Marie-Madeleine Walz
Hi David,

thank you for your advice regarding using AssignTotalChargeToAtoms. Adding it 
resulted in less errors in the bond order assignment.
Unfortunately, it did not remove e.g. the error with sulfite (SO3^2-) that is 
still getting three double bonds.

Another issue is that some of the small rings (e.g. thiirene, C2H2S) are not 
recognised as rings.
This is really confusing as the coordinates fullfil the requirement set in 
mol.cpp, ConnectTheDots(), lines 3027-3028:

// bonded if closer than elemental Rcov + tolerance
cutoff = SQUARE(rad[j] + rad[k] + 0.45);

If you have any advice I would really appreciate it.

With kind regards,
Madeleine

> On 7 Jun 2021, at 15:34, David Koes  wrote:
>
> There is AssignTotalChargeToAtoms which is called when parsing the gamess 
> format, but not, apparently, gaussian.
>
> Again, if you could upload examples of failures to a GitHub Issue (or even 
> better, start a pull request with failing tests added to the testing 
> framework) that would be helpful.
>
> David Koes
>
> Associate Professor
> Computational & Systems Biology
> University of Pittsburgh
>
> On 6/7/21 8:22 AM, Marie-Madeleine Walz wrote:
>> Hi David,
>> thank you for your reply. I tested your code that assigns a sp2 
>> hybridisation to a N as e.g. in azete (in mol.cpp), and it solves the 
>> incorrect bond orders.
>> However, I think that this is a general problem: I have numerous compounds 
>> that get incorrect bond orders and that end up with a different charge than 
>> specified in the Gaussian output file (like e.g. sulfite and sulfur 
>> trioxide). I think it might be a good idea to have somewhere a general 
>> "charge check”. (Maybe there is and I miss to use it? I checked whether OB 
>> is getting the specified charge and it seems to get it.)
>> For example, it would be great if there is a function that checks (i) the 
>> charge of the compound (or whether it is a radical) and (ii) the sum of bond 
>> orders to a certain atom (I guess that is done with GetExplicitValence()). 
>> If a compound is neutral (and not a radical) and ends up with e.g. a C that 
>> only has three single bonds, this should be somehow corrected.
>> Is there any way to do this with the existing OB functions, i.e. without 
>> changing the code?
>> With kind regards,
>> Madeleine









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
http://www.uu.se/en/about-uu/data-protection-policy

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