cellcharter.gr.remove_intra_cluster_links#
- cellcharter.gr.remove_intra_cluster_links(adata, cluster_key, connectivity_key=None, distances_key=None, copy=False)#
Remove links between cells that belong to the same cluster.
Used in
cellcharter.gr.nhood_enrichment()to consider only interactions between cells of different clusters.- Parameters:
adata (
AnnData) – Annotated data object.cluster_key (
str) – Key inanndata.AnnData.obsof the cluster labeling to consider.connectivity_key (
Optional[str] (default:None)) – Key inanndata.AnnData.obspwhere spatial connectivities are stored. Default is:anndata.AnnData.obsp['spatial_connectivities'].distances_key (
Optional[str] (default:None)) – Key inanndata.AnnData.obspwhere spatial distances are stored. Default is:anndata.AnnData.obsp['{{Key.obsp.spatial_dist()}}'].copy (
bool(default:False)) – IfTrue, return the result, otherwise save it to theadataobject.
- Return type:
- Returns:
If
copy = True, returns atuplewith the new spatial connectivities and distances matrices.- Otherwise, modifies the
adatawith the following keys: anndata.AnnData.obsp['{{connectivity_key}}']- the new spatial connectivities.anndata.AnnData.obsp['{{distances_key}}']- the new spatial distances.
- Otherwise, modifies the