FSV_sig: Plot Fraction Spatial Variance vs Q-value

View source: R/plots.R

FSV_sigR Documentation

Plot Fraction Spatial Variance vs Q-value

Description

Plot Fraction Spatial Variance vs Q-value

Usage

FSV_sig(
  results,
  ms_results = NULL,
  certain_only = FALSE,
  log_x = FALSE,
  do_label = TRUE,
  covariate_names = NULL
)

Arguments

results

results from SpatialDE.

ms_results

model selection results, should be a data frame with columns g for gene names and model for the model selected.

certain_only

only plot results with narrow 95% confidence interval.

log_x

Whether to display x axis in log scale.

do_label

display gene names for statistically significant genes, default TRUE.

covariate_names

names of covariates as a reference, default to NULL.

Value

A ggplot2 object.

Author(s)

Davide Corso, Milan Malfait, Lambda Moses

References

Svensson, V., Teichmann, S. & Stegle, O. SpatialDE: identification of spatially variable genes. Nat Methods 15, 343–346 (2018). https://doi.org/10.1038/nmeth.4636

SpatialDE 1.1.3: the version of the Python package used under the hood.

Examples

## Mock up a SpatialExperiment object wit 400 cells and 3 genes
set.seed(42)
spe <- mockSVG(size = 20, tot_genes = 3, de_genes = 1, return_SPE = TRUE)

## Run spatialDE with S4 integration
results <- spatialDE(spe)

## Run model search
msearch <- modelSearch(spe, de_results = results, qval_thresh = NULL,
  verbose = FALSE)

plot <- FSV_sig(results, msearch)


sales-lab/spatialDE documentation built on Feb. 12, 2024, 2:47 p.m.