is_polished

is_polished(fit)

Does the fit carry a per-gene polish (R isPolished)?

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)
from spanormpy._fit import load_fit  # the stored fit as a SpaNormFit object
sn.is_polished(load_fit(adata, "spanorm"))
False
sn.polish_spanorm(adata, verbose=False)
sn.is_polished(load_fit(adata, "spanorm"))
True