0
$\begingroup$

Is there a way to programmatically retrieve graph features (a networkx graph) from Cytoscape in Python 3?

EDIT: To add more details, I had a dictionary of proteins, each protein was associated with a list of proteins that it interacts with. I wanted to create a protein-protein interaction graph so that I could extract graph features from it, including things like k-core value of each node.

$\endgroup$
2
  • $\begingroup$ Welcome to Bioinformatics Beta! It would be helpful if you added more details. What have you attemped? What did you observe when you made the attempt that prevented you from getting the answer you wanted? $\endgroup$
    – user921
    Apr 20, 2020 at 16:49
  • $\begingroup$ Extract this information into what? A Python dictionary? JSON? Pandas DataFrame? It might help the community understand what your issue was if you elaborate. $\endgroup$
    – user921
    Apr 20, 2020 at 16:59

1 Answer 1

1
$\begingroup$

I was able to extract the graph features that I wanted just using networkx, without going through the intermediate step of Cytoscape.

EDIT: Initially, I planned to import the data into Cytoscape and extract graph features from Cytoscape. However, I noticed that a much easier solution would be to just use the methods of the networkx library. I initially had a few graph features in mind that I wanted to extract like k-core value of each node, and I was able to do this using methods from networkX. To calculate k-core for instance, I used the k_core method. For more information on networkX methods, check the docs

$\endgroup$
2
  • $\begingroup$ I'm glad to hear that you solved your own question. If you edit your question to clarify what the issue was, and edit this answer on how you solved it, then this question can provide value to others who come across the same issue. $\endgroup$
    – user921
    Apr 20, 2020 at 16:52
  • $\begingroup$ Implementation details would be useful. For example, did you use nx.get_node_attributes, nx.get_edge_attributes, or something else? $\endgroup$
    – user921
    Apr 20, 2020 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.