netmap.downstream.edge_selection.add_top_edge_annotation_global

netmap.downstream.edge_selection.add_top_edge_annotation_global(grn_adata, top_edges=[0.1], nan_fill=0, key_name='global')[source]

Annotate grn_adata.var with global top-edge cell counts.

Counts, across all cells, how many times each edge appears among the top-N% highest-attribution edges. Results are merged into grn_adata.var as new columns.

Pass multiple values in top_edges when several thresholds are needed; sorting is performed only once regardless of how many thresholds are supplied.

Parameters:
  • grn_adata (anndata.AnnData) – GRN AnnData object to process.

  • top_edges (list of float) – Fractions of top edges to count. Defaults to [0.1].

  • nan_fill (int or float) – Value used to fill edges with no count at a given threshold. Defaults to 0.

  • key_name (str) – Prefix for the new column names. Defaults to 'global'.

Returns:

grn_adata with new columns added to .var

named '{key_name}_cell_count_{top_edge}' for each threshold.

Return type:

anndata.AnnData