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

<p>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 <a href="https://networkx.github.io/" rel="nofollow noreferrer">networkX</a>. To calculate k-core for instance, I used the <a href="https://networkx.github.io/documentation/networkx-1.7/reference/generated/networkx.algorithms.core.k_core.html" rel="nofollow noreferrer">k_core</a> method. For more information on networkX methods, check the <a href="https://networkx.github.io/documentation/stable/" rel="nofollow noreferrer">docs</a></p>

CC BY-SA 4.0
2020-04-20T16:50:48.877Z
2020-04-21T04:10:05.470Z
2020-04-21T04:10:05.470Z
An Ignorant Wanderer
<p>Is there a way to programmatically retrieve graph features (a networkx graph) from Cytoscape in Python 3? </p>

<p>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 <a href="https://en.wikipedia.org/wiki/Degeneracy_(graph_theory)" rel="nofollow noreferrer">k-core</a> value of each node. </p>

<python>
Programmatically retrieve graph features from Cytoscape
# Programmatically retrieve graph features from Cytoscape

(Asked by: username_0 on 2020-04-18)

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](https://en.wikipedia.org/wiki/Degeneracy_(graph_theory)) value of each node.

**Tags:** python

---

## 1 answers

### Answer by username_0 on 2020-04-20. Score: 1

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](https://networkx.github.io/). To calculate k-core for instance, I used the [k\_core](https://networkx.github.io/documentation/networkx-1.7/reference/generated/networkx.algorithms.core.k_core.html) method. For more information on networkX methods, check the [docs](https://networkx.github.io/documentation/stable/)


---

