I am attempting to run the simple_example for the lastest version of wisp, but I am getting the following error:
#Calculatingpaths...#Calculatingtheshortestpathbetweenanyofthespecifiedsourcesandanyofthespecifiedsinks...Traceback(mostrecentcalllast):File"../wisp.py",line1464,in<module>paths=GetPaths(correlation_matrix,sources,sinks,parameters,correlation_matrix_object.average_pdb.residue_identifiers_in_order)File"../wisp.py",line1006,in__init__shortest_length,shortest_path=self.get_shortest_path_length(correlation_matrix,sources,sinks,G)File"../wisp.py",line1109,inget_shortest_path_lengthshort_path=networkx.dijkstra_path(G,source,sink,weight='weight')File"/cm/shared/apps/miniconda/lib/python2.7/site-packages/networkx/algorithms/shortest_paths/weighted.py",line163,indijkstra_pathweight=weight)File"/cm/shared/apps/miniconda/lib/python2.7/site-packages/networkx/algorithms/shortest_paths/weighted.py",line472,insingle_source_dijkstraweight=weight)File"/cm/shared/apps/miniconda/lib/python2.7/site-packages/networkx/algorithms/shortest_paths/weighted.py",line732,inmulti_source_dijkstracutoff=cutoff,target=target)File"/cm/shared/apps/miniconda/lib/python2.7/site-packages/networkx/algorithms/shortest_paths/weighted.py",line817,in_dijkstra_multisourceraisenx.NodeNotFound("Source {} not in G".format(source))networkx.exception.NodeNotFound:Source10notinG
I am running on CentOs version 6.9
with python 2.7.15
numpy 1.15.0
scipy 1.2.0
networkx 2.2
cPickle 1.71
multiprocessing 0.70a1
I have tried fiddling around a bit and setting the source and sink nodes to other values and I get the same 'networkx.exception.NodeNotFound: Source ### not in G' for any choice of source node
Last edit: Wesley 2019-04-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The bug fix seems to work and the shortest path is computed, however, a new error is coming up after 'Starting serial portion of path-finding algorithm':
#Calculatingpaths...#Calculatingtheshortestpathbetweenanyofthespecifiedsourcesandanyofthespecifiedsinks...#Theshortestpathhaslength1.136358953726239#Identifyingthecutoffrequiredtoproduce15paths...#Testingthecutoff1.136358953726239...#Startingserialportionofpath-findingalgorithm(willrunfor5.0seconds)...Traceback(mostrecentcalllast):File"../wisp.py",line1464,in<module>paths=GetPaths(correlation_matrix,sources,sinks,parameters,correlation_matrix_object.average_pdb.residue_identifiers_in_order)File"../wisp.py",line1025,in__init__paths=self.remove_redundant_paths(self.get_paths_between_multiple_endpoints(cutoff_in_array,correlation_matrix,sources,sinks,G,parameters))File"../wisp.py",line1149,inget_paths_between_multiple_endpointspaths.extend(self.get_paths_fixed_endpoints(cutoff,correlation_matrix,source,sink,G,parameters))File"../wisp.py",line1235,inget_paths_fixed_endpointsfind_paths_object.expand_growing_paths_one_step(paths_growing_out_from_source,full_paths_from_start_to_sink,cutoff,sink,G)File"../wisp.py",line761,inexpand_growing_paths_one_stepnode_neighbors=G.neighbors(paths_growing_out_from_source[i][-1])File"/cm/shared/apps/miniconda/lib/python2.7/site-packages/networkx/classes/graph.py",line1251,inneighborsraiseNetworkXError("The node %s is not in the graph."%(n,))networkx.exception.NetworkXError:Thenode10isnotinthegraph.
Anyone have any ideas what is going on?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that the error is again do to a different signature.
Some searching reveals that this was written for networkx versions below 2.0. New versions of networkx (2.0 and up) have had several major changes, such as the signature of the 'Graph' constructor.
There are 2 uses of this constructor in 'wisp.py'
line 1216 and line 1001
in both cases, 'Graph(data=' needs to be replaced with 'Graph(incoming_graph_data=' when using networkx >= 2.0
Fixing these issues leads to a new bug, however:
On line 762, 'for j in range(len(node_neighbors)):' causes an error because new versions of networkx are using dictionary-keyiterator objects to track node_neighbors. This leads to the error: TypeError: object of type 'dictionary-keyiterator' has no len()
The solution is to wrap 'node_neighbors' in 'list()' so
for j in range(len(node_neighbors)):
is replaced by for j in range(len(list(node_neighbors))):
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The above fix seems to just open up a related problem...
it seems that previous versions of networkx use 'list' objects as return values for the 'neighbors' function, but newer versions use 'dictionary-keyiterator' objects.
So the solution is to wrap the result being fed into 'node_neighbors' in 'list()'
e.g.
line 761 node_neighbors=G.neighbors(paths_growing_out_from_source[i][-1])
becomes node_neighbors=list(G.neighbors(paths_growing_out_from_source[i][-1]))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After the above fix, another quirk of newer networkx versions was found.
Line 766: temp[0]=temp[0]+G.edge[temp[-2]][temp[-1]]['weight']
needs to be changed to temp[0]=temp[0]+G.edges[temp[-2],temp[-1]]['weight']
in order to accomadate the new syntax for edge (or edges in v>2.0) access
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SUCCESS!
After the above bug fixes, wisp.py is now sufficiently compatible with networkx >= 2.0 such that it can successfully run the 'simple-example' that comes with the installation.
Can anyone point me to who to contact to construct a patch / update / bug fix/ etc?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Wesley, please forgive me for my delay in getting back to you! My sourceforge emails were going to my old UCSD email address, but I'm now at the University of Pittsburgh. Wonderful that you were able to patch the code to work with the latest version of networkx. Would you mind emailing your updated code to me at durrantj at pitt dot edu? All the best.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have just tested it on a new iMac workstation working with a fresh install of conda (4.6.14, via anaconda), python 2.7 (2.7.16), pip (19.0.3), and networkx (2.2)
Hi Wesley. Just wanted to let you know that I got your code. Much thanks for this contribution! I've gotten this version running on Python 3 as well. We're going to test it intnerally for a bit and then publish it for others to use. Can I include you in the CONTRIBUTORS.md file? All the best.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, feel free to include me in the CONTRIBUTORS file if the patch checks
out. That would be great! Hopefully it will help others. It's always
frustrating when api changes in dependencies break previously functional
packages and libraries.
All the best,
-Dr. Wesley Botello-Smith
Hi Wesley. Just wanted to let you know that I got your code. Much thanks
for this contribution! I've gotten this version running on Python 3 as
well. We're going to test it intnerally for a bit and then publish it for
others to use. Can I include you in the CONTRIBUTORS.md file? All the best.
I am attempting to run the simple_example for the lastest version of wisp, but I am getting the following error:
I am using the version of wisp downloaded from http://sourceforge.net/projects/wisp-pathways/files/1.0/wisp-1.0.zip/download
extracted into ~/bin/wisp
I am running on CentOs version 6.9
with python 2.7.15
numpy 1.15.0
scipy 1.2.0
networkx 2.2
cPickle 1.71
multiprocessing 0.70a1
I have tried fiddling around a bit and setting the source and sink nodes to other values and I get the same 'networkx.exception.NodeNotFound: Source ### not in G' for any choice of source node
Last edit: Wesley 2019-04-01
I think I may have tracked part of the error.
It looks like wisp.py is using
G=networkx.Graph(data=correlation_matrixHowever, under networkx 2.2, the signature for networkx.Graph
is:
'networkx.Graph(self, incoming_graph_data=None, **attr)'
rather than 'networkx.Graph(self,data=None, **attr)'
as it is in some versions...
I am checking to see if updating this line will fix the bug
The bug fix seems to work and the shortest path is computed, however, a new error is coming up after 'Starting serial portion of path-finding algorithm':
Anyone have any ideas what is going on?
It seems that the error is again do to a different signature.
Some searching reveals that this was written for networkx versions below 2.0. New versions of networkx (2.0 and up) have had several major changes, such as the signature of the 'Graph' constructor.
There are 2 uses of this constructor in 'wisp.py'
line 1216 and line 1001
in both cases, 'Graph(data=' needs to be replaced with 'Graph(incoming_graph_data=' when using networkx >= 2.0
Fixing these issues leads to a new bug, however:
On line 762, 'for j in range(len(node_neighbors)):' causes an error because new versions of networkx are using dictionary-keyiterator objects to track node_neighbors. This leads to the error:
TypeError: object of type 'dictionary-keyiterator' has no len()The solution is to wrap 'node_neighbors' in 'list()' so
for j in range(len(node_neighbors)):
is replaced by
for j in range(len(list(node_neighbors))):The above fix seems to just open up a related problem...
it seems that previous versions of networkx use 'list' objects as return values for the 'neighbors' function, but newer versions use 'dictionary-keyiterator' objects.
So the solution is to wrap the result being fed into 'node_neighbors' in 'list()'
e.g.
line 761
node_neighbors=G.neighbors(paths_growing_out_from_source[i][-1])becomes
node_neighbors=list(G.neighbors(paths_growing_out_from_source[i][-1]))After the above fix, another quirk of newer networkx versions was found.
Line 766:
temp[0]=temp[0]+G.edge[temp[-2]][temp[-1]]['weight']needs to be changed to
temp[0]=temp[0]+G.edges[temp[-2],temp[-1]]['weight']in order to accomadate the new syntax for edge (or edges in v>2.0) access
SUCCESS!
After the above bug fixes, wisp.py is now sufficiently compatible with networkx >= 2.0 such that it can successfully run the 'simple-example' that comes with the installation.
Can anyone point me to who to contact to construct a patch / update / bug fix/ etc?
Wesley, please forgive me for my delay in getting back to you! My sourceforge emails were going to my old UCSD email address, but I'm now at the University of Pittsburgh. Wonderful that you were able to patch the code to work with the latest version of networkx. Would you mind emailing your updated code to me at durrantj at pitt dot edu? All the best.
Hi, I tried sending the code you, but I got a reply that the message was not delivered:
i am going to attache the code here.
I have just tested it on a new iMac workstation working with a fresh install of conda (4.6.14, via anaconda), python 2.7 (2.7.16), pip (19.0.3), and networkx (2.2)
let me know if you need anything else.
Hi Wesley. Just wanted to let you know that I got your code. Much thanks for this contribution! I've gotten this version running on Python 3 as well. We're going to test it intnerally for a bit and then publish it for others to use. Can I include you in the CONTRIBUTORS.md file? All the best.
Yes, feel free to include me in the CONTRIBUTORS file if the patch checks
out. That would be great! Hopefully it will help others. It's always
frustrating when api changes in dependencies break previously functional
packages and libraries.
All the best,
-Dr. Wesley Botello-Smith
On Tue, Jul 30, 2019 at 5:06 PM jdurrant jdurrant@users.sourceforge.net
wrote:
Hi Wesley. Wanted to let you know that the latest version is posted here: https://git.durrantlab.pitt.edu/jdurrant/wisp
All the best.
That's great! I'd be very interested in trying out this new version ...
Hi Douglas. Wanted to let you know that the latest version is posted here: https://git.durrantlab.pitt.edu/jdurrant/wisp
All the best.