Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert permutation hetnet to networkx #22

Open
lingling93 opened this issue Apr 28, 2019 · 3 comments
Open

Convert permutation hetnet to networkx #22

lingling93 opened this issue Apr 28, 2019 · 3 comments

Comments

@lingling93
Copy link

Any easy way to convert permutation graph of hetnet to networkx

@dhimmel
Copy link
Member

dhimmel commented Apr 30, 2019

It shouldn't be too hard to use the hetio Python package to read in the JSON-formatted permuted hetnet files and then create a network object from that. I think the MultiGraph is the best networkx data structure to store hetnets, but it is far from perfect:

From #8 (comment):

networkx isn't a good option as it's hetnet support is mediocre --- the MultiGraph supports relationship types but not node types and doesn't really provide first-class type support.

Therefore, I personally have avoided using networkx for hetnets, and instead used Neo4j, hetio, and hetmatpy (when doing matrix operations).

@lingling93 what is your use case for converting the permuted hetnets into networkx? I can help you figure out the proper code to use, but I am wondering if networx is the right solution.

@lingling93
Copy link
Author

I want to compare the result of permutation graph with Hetio graph. Now I'm trying to input hetio graph and permutation graphs to node2vec(https://github.com/eliorc/node2vec), this package only accept networkx type graph.

@dhimmel
Copy link
Member

dhimmel commented May 7, 2019

Interesting, I haven't used node2vec, but my understanding is that it does not understand node or edge types, and thus may be of limited utility for hetnets. An alternative method for which I reviewed the manuscript but have not used, is called edge2vec. Tagging @RoyZhengGao, who's an author on that work.

Would love to see what you uncover about the differences between the permuted and unpermuted Hetionets. Note that we have also created additional permuted derivatives of Hetionet for our recent work. The file hetionet-v1.0-permutations.zip contains 200 permutations using the HetMat format from our new hetmatpy library. CC @zietzm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants