The spatialDE package provides an R wrapper for the Python SpatialDE library, using reticulate and basilisk.
SpatialDE, by Svensson et al., 2018, is a method to identify spatially variable genes (SVGs) in spatially resolved transcriptomics data.
This package started as part of the BiocSpatialChallenges.
Get the latest stable R
release from
CRAN. Then install
spatialDE from
Bioconductor using the following code:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("spatialDE")
The development version of spatialDE can be installed from GitHub with:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
BiocManager::install("sales-lab/spatialDE")
library(spatialDE)
spe <- mockSVG(return_SPE = TRUE)
de_results <- spatialDE(spe)
head(de_results)
#> FSV M g l max_delta max_ll max_mu_hat max_s2_t_hat
#> 0 4.946946e-01 4 Gene_0001 0.5 1.015796e+00 -7.715790 -47.30293 8.742130e+02
#> 1 2.049747e-09 4 Gene_0002 0.5 4.851652e+08 -17.352297 -26.79089 1.479568e-06
#> 2 2.049747e-09 4 Gene_0003 0.5 4.851652e+08 -9.481849 -38.45693 3.048459e-06
#> 3 2.049747e-09 4 Gene_0004 0.5 4.851652e+08 -14.894579 -35.35717 2.576871e-06
#> 4 2.049747e-09 4 Gene_0005 0.5 4.851652e+08 13.885792 -55.54492 6.359242e-06
#> 5 2.049747e-09 4 Gene_0006 0.5 4.851652e+08 11.482157 -57.63152 6.845996e-06
#> model n s2_FSV s2_logdelta time BIC max_ll_null
#> 0 SE 100 53.9651552 1.010988e+03 0.000910759 33.852260 -7.742764
#> 1 SE 100 0.3600476 6.204903e+16 0.001962900 53.125275 -17.354814
#> 2 SE 100 0.1909887 3.291416e+16 0.001904011 37.384378 -9.484365
#> 3 SE 100 7.6755366 1.322769e+18 0.001726151 48.209838 -14.897096
#> 4 SE 100 0.2844247 4.901652e+16 0.001929998 -9.350904 13.883275
#> 5 SE 100 0.1535535 2.646274e+16 0.002086878 -4.543633 11.479640
#> LLR pval qval
#> 0 0.026974403 0.8695431 0.9599889
#> 1 0.002516789 0.9599888 0.9599889
#> 2 0.002516788 0.9599888 0.9599889
#> 3 0.002516792 0.9599888 0.9599889
#> 4 0.002516789 0.9599888 0.9599889
#> 5 0.002516787 0.9599888 0.9599889
Below is the citation output from using citation('spatialDE')
in R.
Please run this yourself to check for any updates on how to cite
spatialDE.
Please note that this package merely provides a wrapper to use the original Python methods in R. If you find these methods useful, please also consider citing the original paper.
Corso D, Malfait M, Moses L (2021). _spatialDE: R wrapper for
SpatialDE_. doi: 10.18129/B9.bioc.spatialDE (URL:
https://doi.org/10.18129/B9.bioc.spatialDE), R package version 0.99.10,
<URL: http://www.bioconductor.org/packages/spatialDE>.
A BibTeX entry for LaTeX users is
@Manual{,
title = {spatialDE: R wrapper for SpatialDE},
author = {Davide Corso and Milan Malfait and Lambda Moses},
year = {2021},
url = {http://www.bioconductor.org/packages/spatialDE},
note = {R package version 0.99.10},
doi = {10.18129/B9.bioc.spatialDE},
}
Svensson V, Teichmann SA, Stegle O (2018). "SpatialDE: identification
of spatially variable genes." _Nature Methods_, *15*(5), 343-346. ISSN
1548-7105, doi: 10.1038/nmeth.4636 (URL:
https://doi.org/10.1038/nmeth.4636), <URL:
https://www.nature.com/articles/nmeth.4636>.
A BibTeX entry for LaTeX users is
@Article{,
title = {SpatialDE: identification of spatially variable genes},
author = {Valentine Svensson and Sarah A. Teichmann and Oliver Stegle},
copyright = {2018 Nature Publishing Group, a division of Macmillan Publishers Limited. All Rights Reserved.},
year = {2018},
journal = {Nature Methods},
volume = {15},
pages = {343--346},
number = {5},
doi = {10.1038/nmeth.4636},
issn = {1548-7105},
url = {https://www.nature.com/articles/nmeth.4636},
}
Please note that the spatialDE project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
This package was developed using biocthis.