Compute spatial variable genes with spatialDE method
spatialDE(
gobject = NULL,
feat_type = NULL,
spat_unit = NULL,
spat_loc_name = "raw",
expression_values = c("raw", "normalized", "scaled", "custom"),
size = c(4, 2, 1),
color = c("blue", "green", "red"),
sig_alpha = 0.5,
unsig_alpha = 0.5,
python_path = NULL,
show_plot = NULL,
return_plot = NULL,
save_plot = NULL,
save_param = list(),
default_save_name = "SpatialDE"
)
Giotto object
feature type
spatial unit
name for spatial locations
gene expression values to use
size of plot
low/medium/high color scheme for plot
alpha value for significance
alpha value for unsignificance
specify specific path to python if required
show plot
return ggplot object
directly save the plot [boolean]
list of saving parameters, see
showSaveParameters
default save name for saving, don't change, change save_name in save_param
a list of data.frames with results and plot (optional)
This function is a wrapper for the SpatialDE method originally implemented in python. See publication doi:10.1038/nmeth.4636
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#>
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#> "/usr/bin/python3"
spatialDE(g)
#> Warning: SpatialDE python module is not installed:
#> install in the right environment or python path with:
#>
#> 'pip install spatialde'
#>
#> or from within R in the Giotto environment with:
#>
#> conda_path = reticulate::miniconda_path()
#> conda_full_path = paste0(conda_path,'/','bin/conda')
#> full_envname = paste0(conda_path,'/envs/giotto_env')
#> reticulate::py_install(packages = c('NaiveDE', 'patsy', 'SpatialDE'),
#> envname = full_envname,
#> method = 'conda',
#> conda = conda_full_path,
#> pip = TRUE,
#> python_version = '3.6')
#> using 'SpatialDE' for spatial gene/pattern detection. If used in
#> published research, please cite:
#> Svensson, Valentine, Sarah A. Teichmann, and Oliver Stegle.
#> 'SpatialDE: Identification of Spatially Variable Genes.'
#> Nature Methods 15, no. 5 (May 2018): 343-46.
#> https://doi.org/10.1038/nmeth.4636.
#> Error in py_run_file_impl(file, local, convert): ModuleNotFoundError: No module named 'pandas'
#> Run `reticulate::py_last_error()` for details.