choderalab / openmoltools

An open set of tools for automating tasks relating to small molecules
MIT License
63 stars 30 forks source link

Fix OEMol / OEGraphMol issue #79

Open kyleabeauchamp opened 9 years ago

kyleabeauchamp commented 9 years ago

So somewhere we are passing an OEGraphMol when we need a three-dimensional OEMol, leading to the following test failure:

kyleb@kyleb-DX4870:~$ nosetests gaff2xml -v
Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR
Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR
Testing drugs molecule_0 with charge method bcc ... ^C
======================================================================
ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate
    for test in g():
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 26, in test_drugs
    molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule)
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2
    return gaff2xml.openeye.molecule_to_mol2(*args, **kwargs)
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2
    for k, mol in enumerate(molecule.GetConfs()):
AttributeError: 'OEGraphMol' object has no attribute 'GetConfs'
-------------------- >> begin captured logging << --------------------
gaff2xml.openeye: DEBUG: ZINC03873936
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate
    for test in g():
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 36, in test_drug
    molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule)
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2
    return gaff2xml.openeye.molecule_to_mol2(*args, **kwargs)
  File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2
    for k, mol in enumerate(molecule.GetConfs()):
AttributeError: 'OEGraphMol' object has no attribute 'GetConfs'
-------------------- >> begin captured logging << --------------------
gaff2xml.openeye: DEBUG: ZINC03873936
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 3 tests in 1.921s
bas-rustenburg commented 9 years ago

For some reason, this function's docstring mentions to use an OEGraphMol, which I think might not be what we want?

https://github.com/choderalab/gaff2xml/blob/master/gaff2xml/openeye.py#L225

On Mon, Dec 8, 2014 at 6:56 PM, Kyle Beauchamp notifications@github.com wrote:

So somewhere we are passing an OEGraphMol when we need a three-dimensional OEMol, leading to the following test failure:

kyleb@kyleb-DX4870:~$ nosetests gaff2xml -v Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR

Testing drugs molecule_0 with charge method bcc ... ^C

ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')

Traceback (most recent call last): File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate for test in g(): File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 26, in test_drugs molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2 return gaff2xml.openeye.molecule_to_mol2(_args, *_kwargs) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2 for k, mol in enumerate(molecule.GetConfs()): AttributeError: 'OEGraphMol' object has no attribute 'GetConfs' -------------------- >> begin captured logging << -------------------- gaff2xml.openeye: DEBUG: ZINC03873936 --------------------- >> end captured logging << ---------------------

ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')

Traceback (most recent call last): File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate for test in g(): File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 36, in test_drug molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2 return gaff2xml.openeye.molecule_to_mol2(_args, *_kwargs) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2 for k, mol in enumerate(molecule.GetConfs()): AttributeError: 'OEGraphMol' object has no attribute 'GetConfs' -------------------- >> begin captured logging << -------------------- gaff2xml.openeye: DEBUG: ZINC03873936 --------------------- >> end captured logging << ---------------------


Ran 3 tests in 1.921s

— Reply to this email directly or view it on GitHub https://github.com/choderalab/gaff2xml/issues/79.

bas-rustenburg commented 9 years ago

And this might be the source of the bug

https://github.com/choderalab/gaff2xml/blob/master/tests/test_drugs.py#L20

On Mon, Dec 8, 2014 at 6:59 PM, Bas Rustenburg < bas.rustenburg@choderalab.org> wrote:

For some reason, this function's docstring mentions to use an OEGraphMol, which I think might not be what we want?

https://github.com/choderalab/gaff2xml/blob/master/gaff2xml/openeye.py#L225

On Mon, Dec 8, 2014 at 6:56 PM, Kyle Beauchamp notifications@github.com wrote:

So somewhere we are passing an OEGraphMol when we need a three-dimensional OEMol, leading to the following test failure:

kyleb@kyleb-DX4870:~$ nosetests gaff2xml -v Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR

Testing drugs molecule_0 with charge method bcc ... ^C

ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')

Traceback (most recent call last): File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate for test in g(): File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 26, in test_drugs molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2 return gaff2xml.openeye.molecule_to_mol2(_args, *_kwargs) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2 for k, mol in enumerate(molecule.GetConfs()): AttributeError: 'OEGraphMol' object has no attribute 'GetConfs' -------------------- >> begin captured logging << -------------------- gaff2xml.openeye: DEBUG: ZINC03873936 --------------------- >> end captured logging << ---------------------

ERROR: Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs')

Traceback (most recent call last): File "/home/kyleb/opt/lib/python2.7/site-packages/nose/loader.py", line 251, in generate for test in g(): File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/tests/test_drugs.py", line 36, in test_drug molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/utils.py", line 418, in molecule_to_mol2 return gaff2xml.openeye.molecule_to_mol2(_args, *_kwargs) File "/home/kyleb/opt/lib/python2.7/site-packages/gaff2xml-0.1-py2.7.egg/gaff2xml/openeye.py", line 253, in molecule_to_mol2 for k, mol in enumerate(molecule.GetConfs()): AttributeError: 'OEGraphMol' object has no attribute 'GetConfs' -------------------- >> begin captured logging << -------------------- gaff2xml.openeye: DEBUG: ZINC03873936 --------------------- >> end captured logging << ---------------------


Ran 3 tests in 1.921s

— Reply to this email directly or view it on GitHub https://github.com/choderalab/gaff2xml/issues/79.

davidlmobley commented 9 years ago

I just ran into this issue too (trying to start using gaff2xml in order to hopefully increase overlap between what my lab is doing and what you are doing). Is there a fix in the works? Should I try and fix it? My recollection is that an OEGraphMol is by necessity single conformation so it has no function GetConfs.

kyleabeauchamp commented 9 years ago

What are you specifically trying to do?

kyleabeauchamp commented 9 years ago

E.g. if this is FreeSolv related, I have a script here (https://github.com/choderalab/gbff/blob/master/code/rebuild_freesolv.py) that does a lot of the things we might want to do...

davidlmobley commented 9 years ago

Just run the tests, at this point. :) Non-critical, but I assumed initially (until I read this) that I should be concerned if the tests can't run without error.

On Tue, Apr 28, 2015 at 5:32 PM, Kyle Beauchamp notifications@github.com wrote:

What are you specifically trying to do?

— Reply to this email directly or view it on GitHub https://github.com/choderalab/gaff2xml/issues/79#issuecomment-97271881.

David Mobley dmobley@gmail.com 949-385-2436

davidlmobley commented 9 years ago

Yes, I just found that. And I'm about to e-mail to kick off a somewhat larger discussion.

On Tue, Apr 28, 2015 at 5:33 PM, Kyle Beauchamp notifications@github.com wrote:

E.g. if this is FreeSolv related, I have a script here ( https://github.com/choderalab/gbff/blob/master/code/rebuild_freesolv.py) that does a lot of the things we might want to do...

— Reply to this email directly or view it on GitHub https://github.com/choderalab/gaff2xml/issues/79#issuecomment-97272036.

David Mobley dmobley@gmail.com 949-385-2436

davidlmobley commented 9 years ago

Did you want us to look into this issue? (i.e. ideally the tests should run without error.)

kyleabeauchamp commented 9 years ago

101 might be the answer here, testing this overnight.

davidlmobley commented 9 years ago

I still have the same issue running the nose tests on 0.6.5 which I just installed via conda. ("Failure: AttributeError ('OEGraphMol' object has no attribute 'GetConfs') ... ERROR") This is for 2-acetoxybenzoic acid.

kyleabeauchamp commented 9 years ago

What version of OpenEye are you using? I wonder if there's a difference between the versions.

davidlmobley commented 9 years ago

Ah, it could be. I am in OEChem 20150211 (I did not upgrade to the latest beta yet). What are you using?

Thanks.

On Thu, Apr 30, 2015 at 3:36 PM, Kyle Beauchamp notifications@github.com wrote:

What version of OpenEye are you using? I wonder if there's a difference between the versions.

— Reply to this email directly or view it on GitHub https://github.com/choderalab/openmoltools/issues/79#issuecomment-97990600 .

David Mobley dmobley@gmail.com 949-385-2436

kyleabeauchamp commented 9 years ago

OpenEye-python2.7-ubuntu-14.04-x64-2015.2.3.tar.gz

davidlmobley commented 9 years ago

Hmm, mine was installed via pip: pip install -i https://pypi.binstar.org/openeye/simple openeye

DM

On Thu, Apr 30, 2015 at 4:03 PM, Kyle Beauchamp notifications@github.com wrote:

OpenEye-python2.7-ubuntu-14.04-x64-2015.2.3.tar.gz

— Reply to this email directly or view it on GitHub https://github.com/choderalab/openmoltools/issues/79#issuecomment-97995207 .

David Mobley dmobley@gmail.com 949-385-2436

kyleabeauchamp commented 9 years ago

FWIW, here is the output on my machine:

nosetests openmoltools -v --exe

[...]

Testing molecule benzene ... ok
Testing molecule toluene ... ok
Testing molecule phenol ... ok
Testing molecule benzene-1,2-diol ... ok
Testing molecule 2-acetoxybenzoic acid ... ok
Testing drugs ZINC03873936 ... ok
Testing drugs ZINC19632834 ... ok
Testing drugs ZINC03647770 ... ok
Testing drugs ZINC03815424 ... ok
[...]
davidlmobley commented 9 years ago

Any chance you want to try this out with one of the pip/conda-installable OpenEye versions? I'd just as soon NOT go back to the "dark ages" way of installing just to see if it will work for me if I do. The alternative is to see if it breaks for you if you use the newer way of installing.

On Thu, Apr 30, 2015 at 4:21 PM, Kyle Beauchamp notifications@github.com wrote:

FWIW, here is the output on my machine:

nosetests openmoltools -v --exe

[...]

Testing molecule benzene ... ok Testing molecule toluene ... ok Testing molecule phenol ... ok Testing molecule benzene-1,2-diol ... ok Testing molecule 2-acetoxybenzoic acid ... ok Testing drugs ZINC03873936 ... ok Testing drugs ZINC19632834 ... ok Testing drugs ZINC03647770 ... ok Testing drugs ZINC03815424 ... ok [...]

— Reply to this email directly or view it on GitHub https://github.com/choderalab/openmoltools/issues/79#issuecomment-97998036 .

David Mobley dmobley@gmail.com 949-385-2436

kyleabeauchamp commented 9 years ago

Sure, I will try out the pip version

On 05/01/2015 11:56 AM, davidlmobley wrote:

Any chance you want to try this out with one of the pip/conda-installable OpenEye versions? I'd just as soon NOT go back to the "dark ages" way of installing just to see if it will work for me if I do. The alternative is to see if it breaks for you if you use the newer way of installing.

On Thu, Apr 30, 2015 at 4:21 PM, Kyle Beauchamp notifications@github.com wrote:

FWIW, here is the output on my machine:

nosetests openmoltools -v --exe

[...]

Testing molecule benzene ... ok Testing molecule toluene ... ok Testing molecule phenol ... ok Testing molecule benzene-1,2-diol ... ok Testing molecule 2-acetoxybenzoic acid ... ok Testing drugs ZINC03873936 ... ok Testing drugs ZINC19632834 ... ok Testing drugs ZINC03647770 ... ok Testing drugs ZINC03815424 ... ok [...]

— Reply to this email directly or view it on GitHub

https://github.com/choderalab/openmoltools/issues/79#issuecomment-97998036 .

David Mobley dmobley@gmail.com 949-385-2436

— Reply to this email directly or view it on GitHub https://github.com/choderalab/openmoltools/issues/79#issuecomment-98164430.

jchodera commented 9 years ago

I can also take a stab at getting this to work on travis. We got info from OpenEye on how to get this to work by grabbing the license file via HTTP. I think we just have to host our group license file somewhere that isn't google indexed or linked to.

John D. Chodera Assistant Faculty Member, Computational Biology Memorial Sloan-Kettering Cancer Center email: j choderaj@mskcc.orgohn.chodera@choderalab.org office: 646.888.3400 fax: 510.280.3760 mobile: 415.867.7384 url: http://www.choderalab.org

jchodera commented 9 years ago

Actually, that seems insufficiently insecure. Will consult with OpenEye further.

davidlmobley commented 9 years ago

Yes, I can't imagine how you could get that to work without making the URL of your license file public. It may require them rethinking how they handle licensing to a limited extent (i.e. maybe they can allow X number of OE tool calls without a license within 24 hours?).

David

On Fri, May 1, 2015 at 9:11 AM, John Chodera notifications@github.com wrote:

Actually, that seems insufficiently insecure. Will consult with OpenEye further.

— Reply to this email directly or view it on GitHub https://github.com/choderalab/openmoltools/issues/79#issuecomment-98167999 .

David Mobley dmobley@gmail.com 949-385-2436