Skip to contents

Compare two samples

The main function: the spatial correlation test and the spatial similarity for every gene, and the methods of its result.

compareSpatial()
Compare the spatial expression patterns of genes between two samples
print(<STcompareResult>) summary(<STcompareResult>) print(<summary.STcompareResult>) `[`(<STcompareResult>) as.data.frame(<STcompareResult>)
Methods for compareSpatial() results

Spatial correlation, legacy functions

The correlation functions of earlier versions. They reproduce the published analyses exactly.

spatialCorrelationGeneExp()
Spatial correlation test for every gene of two samples
spatialCorrelationGeneExpIterPermutations()
Spatial correlation test with more permutations for promising genes
spatialCorrelationGeneExpWithinSample()
Spatial correlation test between pairs of genes of one sample
spatialCorrelation()
Spatial correlation test of two vectors of values at the same locations
viladomatCorrelation()
Spatially autocorrelated surrogates and permutation p-value for one direction

Visualization

Standard figures of a compareSpatial() result: one gene with its maps, similarity classes and statistics, and the overview of all genes. The legacy functions plot single genes from the results of the legacy functions.

plotGene()
Standard figure of one gene in a compareSpatial() result
plotOverview()
Overview figure of a compareSpatial() result
linearRegression()
Plot a gene's values in two samples, coloured by similarity class
pixelClass()
Map the similarity class of every pixel
plotCorrelationGeneExp()
Plot a gene's values in two samples at the shared pixels
savePlots()
Maps, pixel classes and scatter plot of genes, optionally saved as PDF

Spatial similarity, legacy function

The similarity with the class of every pixel.

spatialSimilarity()
Computes spatial similarity of gene expression between two SpatialExperiments.

Example data

speKidney
Simulated Kidney SpatialExperiment Data
simRanPatternRasts
Simulated Random Spatially Patterned Kidney Datasets