topSVGs

Export top SVG results to a data frame

Description

Export top SVG results to a data frame

Usage

topSVGs(spe, n = 10, fdr = 1)

Arguments

spe a SpatialExperiment object with SVG results from SpaNormSVG.
n a numeric, specifying the number of top SVGs to call.
fdr a numeric, specifying the false discovery rate (FDR) threshold for calling SVGs.

Value

A data frame containing the top SVGs from F-test results including F-statistics, p-values and FDR.

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), SpaNormSVG() and SpaNormPCA() already applied) that is fitted once per build. The outputs are those of the code shown.

library("SpaNorm")


library(SpatialExperiment)
library(ggplot2)

data(HumanDLPFC)

HumanDLPFC = SpaNorm(HumanDLPFC, sample.p = 0.05, df.tps = 2, tol = 1e-2)
(1/2) Retrieve precomputed SpaNorm model
(2/2) Normalising data
HumanDLPFC = SpaNormSVG(HumanDLPFC)
(1/3) Retrieving SpaNorm model
(2/3) Retrieving Null SpaNorm model
(3/3) Finding SVGs
102 SVGs found (FDR < 0.05)
topSVGs = topSVGs(HumanDLPFC, n = 10)