Skip to content

Commit

Permalink
Print network information
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Nov 15, 2024
1 parent 4eb6c83 commit 49d2e0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PopPUNK/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,13 @@ def outputsForCytoscape(G, G_mst, isolate_names, clustering, outPrefix, epiCsv,

# Save each component too (useful for very large graphs)
component_assignments, component_hist = gt.label_components(G)
print("All assignments: " + str(component_assignments))
for component_idx in range(len(component_hist)):
remove_list = []
for vidx, v_component in enumerate(component_assignments.a):
print("Index: " + str(vidx))
print("Component: " + str(v_component))
print("Name: " + str(isolate_labels[vidx]))
if v_component != component_idx:
remove_list.append(vidx)
G.remove_vertex(remove_list)
Expand Down

0 comments on commit 49d2e0c

Please sign in to comment.