False discovery rate threshold in [0, 1]; genes with svg_fdr <= fdr are kept.
1.0
layer
str | None
Counts layer (default X). Like R’s checkSPE, the counts are validated; the SVG columns are the only other thing checked.
None
table_key
str | None
The table to read, for SpatialData.
None
Returns
Name
Type
Description
A frame with columns svg_F, svg_p and svg_fdr, indexed by gene name and sorted
by FDR (ties in gene order). A gene whose FDR is NaN is kept, with all-NaN statistics, after
the sorted finite rows and counted toward n, as R's results\[svg.fdr <= fdr, \] keeps
one all-NA row per NaN (R names them NA, NA.1, …; here they keep the gene name).
Examples
Note
The code below runs when the site is built, on a small pre-fitted subset of HumanDLPFC (301 genes x 4015 spots; spanorm(sample_p=0.05, df_tps=2), spanorm_svg() and spanorm_pca() already applied) that is fitted once per build and loaded as adata. The outputs are those of the code shown.
import spanormpy as sn# adata: the HumanDLPFC AnnData (raw counts in X, coordinates in obsm["spatial"]),# already fitted with sn.spanorm(adata, sample_p=0.05, df_tps=2)# adata: also holds spatially variable gene results from sn.spanorm_svg(adata)sn.top_svgs(adata, n=10)