Generate a spot plot for cell-cell interactions similar to the bertin plot. The size or height of the dot or bar represents the interaction strength. The color of the bars and dots represents the p values.

PlotSpot(
  object,
  which.cell = NULL,
  which.gene = NULL,
  aggregate = c("none", "cell", "gene"),
  counted = FALSE,
  selected = FALSE,
  color = "RdBu",
  color.bins = 7,
  type = c("dot", "bar"),
  order = FALSE,
  order.dist = "minkowski",
  p = 1,
  filter = FALSE,
  low.cutoff = -Inf,
  high.cutoff = Inf,
  dot.scale = 8,
  plot.y.axis = TRUE,
  fix.y.axis = TRUE,
  do.return = FALSE
)

Arguments

object

Matchmaker object.

which.cell

Interacting cell type name (saperated by '|' i.e 'DC|Mac') or index to plot. Default is NULL.

which.gene

Interacting gene name (saperated by '_' i.e 'CSF1_CSF1R') or index to plot. Default is NULL.

aggregate

Type of aggregation used. Default is none.

  • cell, aggregated by cell-cell interactions strengths (Default).

  • gene, aggregated by ligand-receptor pairs strengths.

  • none, no aggregation.

counted

Aggregate interactions counts instead of strengths. Default is FALSE.

selected

Use selected data if calculated. Default is FALSE.

color

Color palette name. Default is "RdBu" (reversed order), high values are in blue and low values in red See details brewer.pal.

color.bins

Number of differen colors in pallete. Default is 7. See detail brewer.pal.

type

Types of plot. Default is dotplot.

  • dot, dotplot or bertin plot (Default).

  • bar, barplot.

order

Whether to order the input data. Default is TRUE. See details seriate.

order.dist

Distance measure to be used. Default is "minkowski". See details dist.

p

Power of Minkowski distance Default is 1, aka Manhattan distance. See details dist.

filter

Whether to filter the input data based on low.cutoff and high.cutoff. Default is FALSE.

low.cutoff

Lower cutoff bound below which will be removed. Default is negative infinity.

high.cutoff

Upper cutoff bound above which will be removed. Default is positive infinity.

dot.scale

Scale the size of the dots. Default is 8.

plot.y.axis

Whether to show y axis for each barplot. Default is TRUE.

fix.y.axis

Whether to fix the all barplot ticks or use the relative ticks for each barplot. Default is TRUE.

do.return

Whether to return the data used to plot. Default is FALSE.

Value

A ggplot object or a list with strength and p value data used to generate the plot.

Examples

if (FALSE) {
 PlotSpot(object, which.cell = 1:10, which.gene = 1:10)
}