netmap.downstream.regulon.get_sourcewise_jaccard_regulons¶
- netmap.downstream.regulon.get_sourcewise_jaccard_regulons(all_signatures, keep_edges, n_top=50)[source]¶
Compute per-source-gene Jaccard similarity matrices across clusters.
For each cluster, retrieves the top
n_topgenes by Wilcoxon rank-sum score fromall_signatures, then for each top source gene compares its target gene lists across all clusters using pairwise Jaccard similarity. Returns a square similarity matrix per source gene.Note
This function references
grn_adata3andscfrom the enclosing or module-level scope. This is a known code issue and is not changed here.- Parameters:
all_signatures (anndata.AnnData) – AnnData object storing Wilcoxon differential regulon results under the
'wilcoxon'key in.uns['rank_genes_groups']. Cluster labels are read fromgrn_adata3.obs.leiden_remap(module-level variable).keep_edges (dict) – Nested regulon dict as returned by
select_top_edges(), accessed viakeep_edges['all'][cluster]['edges'].n_top (int) – Number of top-ranked genes per cluster to consider. Defaults to 50.
- Returns:
Mapping of source gene name to a square
pd.DataFramewhere both index and columns are cluster labels and values are Jaccard similarity scores. Only genes appearing in more than one cluster are included.- Return type: