plotInterCellTypeSpatialCrossCor | R Documentation |
Expression correlation between cells of group A expressing gene A with neighbors of cells of group A in group B expressing gene B
plotInterCellTypeSpatialCrossCor( gexpA, gexpB, groupA, groupB, weight, fun = mean, ... )
gexpA |
Expression of gene A |
gexpB |
Expression of gene B |
groupA |
Cells of group A |
groupB |
Cells of group B |
weight |
Adjacency weight matrix |
fun |
Function for combining multiple gene expression values (ex. mean, median, max) |
... |
Additional plotting parameters |
None
# Simulate data set.seed(0) N <- 100 pos <- cbind(rnorm(N), rnorm(N)) rownames(pos) <- paste0('cell', 1:N) colnames(pos) <- c('x', 'y') weight <- getSpatialNeighbors(pos) ctA <- sample(rownames(pos), N/2) ctB <- setdiff(rownames(pos), ctA) gexpA <- pos[,2] gexpA[ctB] <- 0 gexpB <- -pos[,2] gexpB[ctA] <- 0 plotEmbedding(pos, col=gexpA) plotEmbedding(pos, col=gexpB) plotInterCellTypeSpatialCrossCor(gexpA, gexpB, ctA, ctB, weight) plotInterCellTypeSpatialCrossCor(gexpB, gexpA, ctB, ctA, weight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.