snapatac2.pl.network_edge_stat#

snapatac2.pl.network_edge_stat(network, **kwargs)[source]#

Plot edge score distributions by source and target node type.

Use this function to inspect correlation score distributions across network edge categories.

Anti-Patterns#

  • Do NOT pass a generic NetworkX graph. The input must be a rustworkx.PyDiGraph whose nodes expose type and whose edges expose score attributes such as cor_score.

  • Do NOT use this function to summarize regression scores only. The current plot displays correlation score violins.

param network:

Regulatory network whose nodes provide a type attribute and whose edge data may provide cor_score and regr_score attributes.

type network:

PyDiGraph

type **kwargs:

param **kwargs:

Additional rendering options passed to snapatac2.pl.render_plot, such as show, interactive, out_file, and scale.

returns:

Returns a Plotly figure when show=False and out_file=None; otherwise renders or saves the plot and returns None.

rtype:

plotly.graph_objects.Figure or None

Examples

>>> from types import SimpleNamespace
>>> import rustworkx as rx
>>> import snapatac2 as snap
>>> graph = rx.PyDiGraph()
>>> peak = graph.add_node(SimpleNamespace(type="peak"))
>>> gene = graph.add_node(SimpleNamespace(type="gene"))
>>> graph.add_edge(peak, gene, SimpleNamespace(cor_score=0.7, regr_score=0.2))
>>> fig = snap.pl.network_edge_stat(graph, show=False)
>>> fig.update_layout(title="Network edge scores")