scviva.tools.vision.compute_knn_weights_from_tree_lca_anndata#

scviva.tools.vision.compute_knn_weights_from_tree_lca_anndata(adata, newick, min_size=20, obsp_key='weights')[source]#

Compute LCA-based tree KNN weights and store in adata.obsp[obsp_key].

Parameters:
adata AnnData

Annotated data matrix. adata.obs_names must match leaf labels in the Newick tree.

newick str

Newick-format tree string.

min_size int

Minimum clade size (excluding self). Default 20.

obsp_key str

Destination key in adata.obsp, by default "weights".

Return type:

AnnData

Returns:

AnnData (modified in-place)