netmap.masking.internal¶
Neighbourhood-expression masking for GRN edges.
Functions in this module build binary cell×edge masks that indicate whether
both the source and target genes of an edge are expressed in the local kNN
neighbourhood of each cell. The masks are stored in grn_adata.layers['mask']
and used downstream to filter low-confidence edges.
Functions
Annotate edges with per-cluster mask support fractions and candidacy flags. |
|
Compute cluster-wise Spearman rank correlation between source and target gene expression for each edge in grn_adata, adding a '{cluster}_spearman' column to grn_adata.var for every cluster. |
|
Create a binary cell×edge co-expression mask and add it to the GRN AnnData. |
|
Binarize gene expression to 0/1 based on an expression threshold. |
|
Creates a dense 2D array of pairwise masks using preallocation. |
|
Compute Spearman correlation between forward and reverse edge attribution scores. |
|
Checks if each gene is expressed in the k-nearest neighbors (kNN) of each cell. |