netmap.masking.internal.get_neighborhood_expression¶
- netmap.masking.internal.get_neighborhood_expression(adata, knn_neighbours=10, required_neighbours=1)¶
Checks if each gene is expressed in the k-nearest neighbors (kNN) of each cell.
- Parameters:
adata (anndata.AnnData) – An AnnData object with a kNN graph in adata.obsp[‘connectivities’].
- Returns:
- A cell x gene binary DataFrame where a value of 1 indicates
that the gene is expressed in at least one of the cell’s nearest neighbors, and 0 otherwise.
- Return type:
pd.DataFrame