WIP
This commit is contained in:
+4
-4
@@ -38,7 +38,7 @@ def spatial_graph(adata):
|
||||
|
||||
def apply(g, seed, weight, convex_hull, ax, ax2, method):
|
||||
# calculate centrality values
|
||||
vp = method(g, weight=weight)
|
||||
vp, ep = method(g, weight=weight)
|
||||
vp.a = np.nan_to_num(vp.a) # correct floating point values
|
||||
min_val, max_val = vp.a.min(), vp.a.max()
|
||||
vp.a = (vp.a - min_val) / (max_val - min_val)
|
||||
@@ -63,13 +63,13 @@ fig = plt.figure(figsize=(21, 5))
|
||||
ax1, ax2, ax3 = fig.subplots(1, 3)
|
||||
|
||||
# plot graph with convex_hull
|
||||
vp = closeness(g, weight=weight)
|
||||
vp, ep = betweenness(g, weight=weight)
|
||||
vp.a = np.nan_to_num(vp.a) # correct floating point values
|
||||
min_val, max_val = vp.a.min(), vp.a.max()
|
||||
vp.a = (vp.a - min_val) / (max_val - min_val)
|
||||
|
||||
plot.graph_plot(fig, ax1, g, vp, convex_hull, f"Pointcloud (seed: {seed})", False)
|
||||
|
||||
apply(g, seed, weight, convex_hull, ax2, ax3, closeness)
|
||||
apply(g, seed, weight, convex_hull, ax2, ax3, betweenness)
|
||||
|
||||
fig.savefig(f"Distance_5000_node_closeness.svg", format='svg')
|
||||
fig.savefig(f"Distance_5000_node_betweenness.svg", format='svg')
|
||||
|
||||
Reference in New Issue
Block a user