Network Analysis, Mass Spectrometry, Python, Open Science.
for c in nx.connected_components(our_network)] Most of the time nodes with no (or very few) connections are less interesting, so let’s kick them out and only list the larger clusters. clusters = {} for i, subnet in enumerate(subnetworks): if len(subnet.nodes) > 2: # exclude clusters with <=2 nodes