nichepca.graph_construction.remove_long_links#
- nichepca.graph_construction.remove_long_links(adata=None, edge_index=None, edge_weight=None, dist_percentile=99.0, copy=False)#
Remove links with a distance larger than a given percentile.
- Parameters:
adata (
AnnData|None(default:None)) – Annotated data object.edge_index (
ndarray|None(default:None)) – Edge index of the graph.edge_weight (
ndarray|None(default:None)) – Edge weight of the graph.dist_percentile (
float(default:99.0)) – Percentile threshold for the maximum edge weight.copy (
bool(default:False)) – Whether to return a copy of the graph.
- Returns:
Tuple[np.ndarray, np.ndarray] | None If
copy=True, returns the edge index and edge weight. Otherwise, stores the new edge index and edge weight inadata.uns.
Notes
This function is inspired by the
remove_long_linksfunction in thecellcharterpackage CSOgroup/cellcharter.