MobleyLab / Lomap

Alchemical mutation scoring map
MIT License
37 stars 17 forks source link

Error in installing Lomap with networkx 2/fix networkx 2 compatibility #33

Closed skfegan closed 2 years ago

skfegan commented 6 years ago

I tried to install Lomap using conda following the installation instructions from the README.md. It appeared to install without any trouble, but when I ran the test I got an error in the build_graph function (see the output from test_lomap.py below). What do I need to do to get Lomap correctly installed and running?

Thanks, Sarah

.usage: LOMAPv1.0 [-h] [-p PARALLEL] [-v {off,info,pedantic}] [-t TIME] [-e ECRSCORE] [-o] [-n NAME] [-d] [-m MAX] [-c CUTOFF] directory LOMAPv1.0: error: argument -p/--parallel: invalid int value: '-1.5' usage: LOMAPv1.0 [-h] [-p PARALLEL] [-v {off,info,pedantic}] [-t TIME] [-e ECRSCORE] [-o] [-n NAME] [-d] [-m MAX] [-c CUTOFF] directory LOMAPv1.0: error: argument -v/--verbose: invalid choice: 'err_option' (choose from 'off', 'info', 'pedantic') usage: LOMAPv1.0 [-h] [-p PARALLEL] [-v {off,info,pedantic}] [-t TIME] [-e ECRSCORE] [-o] [-n NAME] [-d] [-m MAX] [-c CUTOFF] directory LOMAPv1.0: error: argument -t/--time: invalid int value: '-1.5' usage: LOMAPv1.0 [-h] [-p PARALLEL] [-v {off,info,pedantic}] [-t TIME] [-e ECRSCORE] [-o] [-n NAME] [-d] [-m MAX] [-c CUTOFF] directory LOMAPv1.0: error: argument -m/--max: invalid int value: '-5.0' usage: LOMAPv1.0 [-h] [-p PARALLEL] [-v {off,info,pedantic}] [-t TIME] [-e ECRSCORE] [-o] [-n NAME] [-d] [-m MAX] [-c CUTOFF] directory LOMAPv1.0: error: argument -m/--max: invalid int value: 'string' ..E....

ERROR: test_graph (main.TestLomap)

Traceback (most recent call last): File "test_lomap.py", line 92, in test_graph graph = db.build_graph() File "/home/skfegan/miniconda2/lib/python2.7/site-packages/lomap-0.0.0-py2.7.egg/lomap/dbmol.py", line 531, in build_graph Gr = graphgen.GraphGen(self) File "/home/skfegan/miniconda2/lib/python2.7/site-packages/lomap-0.0.0-py2.7.egg/lomap/graphgen.py", line 164, in init self.connectSubgraphs() File "/home/skfegan/miniconda2/lib/python2.7/site-packages/lomap-0.0.0-py2.7.egg/lomap/graphgen.py", line 524, in connectSubgraphs connectSuccess = self.connectGraphComponents_brute_force() File "/home/skfegan/miniconda2/lib/python2.7/site-packages/lomap-0.0.0-py2.7.egg/lomap/graphgen.py", line 586, in connectGraphComponents_brute_force similarity = self.dbase.loose_mtx[nodesOfI[k],nodesOfJ[l]] File "/home/skfegan/miniconda2/lib/python2.7/site-packages/networkx/classes/reportviews.py", line 178, in getitem return self._nodes[n] KeyError: 0


Ran 8 tests in 4.037s

FAILED (errors=1)

davidlmobley commented 6 years ago

@shuail - are you able to take a look/have you run into this? If not I'll have to dig in.

shuail commented 6 years ago

Yes, I take a look and it seems that the lomap package in conda is out of data. I think all my previous tests and the travis tests are all tested using the source code directly not through the conda package.

davidlmobley commented 6 years ago

Ah, OK. So this means I just need to refresh my memory on how to update the conda version and update that.

In the meantime, @skfegan , you should be able to resolve your issue by installing from source.

skfegan commented 6 years ago

I have installed lomap from source and am still having the same problem. Is there a specific version of NetworkX that I should have (currently version 2.1 is installed)? I am running this on my Ubuntu 16.04 workstation.

shuail commented 6 years ago

@skfegan Yes, I think the current Lomap is compatible with networkx 1.11 but not networkx 2.0 and beyond #30, could you try to downgrade your networkx and see if it works?

davidlmobley commented 6 years ago

@shuail - do you have any thoughts about updating to be networkx 2 compatible?

shuail commented 6 years ago

@davidlmobley here is a note I found https://networkx.github.io/documentation/stable/release/migration_guide_from_1.x_to_2.0.html, will take a deep look this weekend and see if I could find all incompatible pieces.

skfegan commented 6 years ago

Switching to networkx 1.11 works.

davidlmobley commented 6 years ago

@skfegan - thanks. I'll reopen so we remember to investigate networkx 2 compatibility

shuail commented 6 years ago

Create a pull request here #34 to make the code compatible with networkx > 2.0. Sorry that it takes longer than I thought, ends up that I need to manually port the test template pickle file to be read by networkx version 2.0.