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.obsp
where spatial connectivities are stored. Default is:anndata.AnnData.obsp
['spatial_connectivities']
.distances_key (
Optional
[str
] (default:None
)) – Key inanndata.AnnData.obsp
where spatial distances are stored. Default is:anndata.AnnData.obsp
['{{Key.obsp.spatial_dist()}}']
.neighs_key (
Optional
[str
] (default:None
)) – Key inanndata.AnnData.uns
where 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 theadata
object.
- Return type:
- Returns:
If
copy = True
, returns atuple
with the new spatial connectivities and distances matrices.- Otherwise, modifies the
adata
with 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}}']
-dict
containing parameters.
- Otherwise, modifies the