R/07_Visualization.R
fireflyPlot.Rd
Calculate the shortest distance between cells belonging to two different groups, and visualize distance measures of the first cell type
fireflyPlot(
data = NULL,
label = NULL,
ct1 = NULL,
ct1.lwd = 0,
ct2 = NULL,
ct2.lwd = 0,
fovs = NULL,
ct1.colthresh = 0.99
)
a Seurat object containing Kandinsky data (`KanData()`)
character string specifying the variable name to be used to defne cell annotation groups
cell type A label
linewidth to use in plot for cell type A boundaries
cell type B label
linewidth to use in plot for cell type B boundaries
list of fov IDs to include in the analysis. If NULL, all fovs will be considered for the analysis
quantile threshold to apply to the distance colorscheme for cells belonging to cell type A in the spatial plot. For instance, if `ct1.coltresh = 0.99`, any distance greater than the 99 percentile will not result in a lighter or darker cell color
a list object containing the data frame with the distance measurement plus a spatial plot reporting cells A colored according to their distance from cells B
For two groups A and B of cells of interest, this function will calculate the minimum distance from each cell of type A to cells of type B. Find the closest cell of type B for each cell of type A, then plot the corresponding euclidean distance as spatial heatmap of cells (type A/B) with the color scale based on the euclidean distance of cells A to the closest cell B, and with cells of type B colored in white to resemble a 'firefly' effect