cellcharter.gr.remove_long_links#
- cellcharter.gr.remove_long_links(adata, distance_percentile=99.0, connectivity_key=None, distances_key=None, neighs_key=None, copy=False)#
Remove links between cells at a distance bigger than a certain percentile of all positive distances.
It is designed for data with generic coordinates.
- Parameters:
adata (
AnnData) – Annotated data object.distance_percentile (
float(default:99.0)) – Percentile of the distances between cells over which links are trimmed after the network is built.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()}}'].neighs_key (
Optional[str] (default:None)) – Key inanndata.AnnData.unswhere the parameters from gr.spatial_neighbors are stored. Default is:anndata.AnnData.uns['{{Key.uns.spatial_neighs()}}'].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.anndata.AnnData.uns['{{neighs_key}}']-dictcontaining parameters.
- Otherwise, modifies the