plotNhoodExpressionDA: Visualize gene expression in neighbourhoods

View source: R/plotNhoods.R

plotNhoodExpressionDAR Documentation

Visualize gene expression in neighbourhoods

Description

Plots the average gene expression in neighbourhoods, sorted by DA fold-change

Plots the average gene expression in neighbourhood groups

Usage

plotNhoodExpressionDA(
  x,
  da.res,
  features,
  alpha = 0.1,
  subset.nhoods = NULL,
  cluster_features = FALSE,
  assay = "logcounts",
  scale_to_1 = FALSE,
  show_rownames = TRUE,
  highlight_features = NULL
)

plotNhoodExpressionGroups(
  x,
  da.res,
  features,
  alpha = 0.1,
  subset.nhoods = NULL,
  cluster_features = FALSE,
  assay = "logcounts",
  scale_to_1 = FALSE,
  show_rownames = TRUE,
  highlight_features = NULL,
  grid.space = "free"
)

Arguments

x

A Milo object

da.res

a data.frame of DA testing results

features

a character vector of features to plot (they must be in rownames(x))

alpha

significance level for Spatial FDR (default: 0.1)

subset.nhoods

A logical, integer or character vector indicating a subset of nhoods to show in plot (default: NULL, no subsetting)

cluster_features

logical indicating whether features should be clustered with hierarchical clustering. If FALSE then the order in features is maintained (default: FALSE)

assay

A character scalar that describes the assay slot to use for calculating neighbourhood expression. (default: logcounts) Of note: neighbourhood expression will be computed only if the requested features are not in the nhoodExpression slot of the milo object. If you wish to plot average neighbourhood expression from a different assay, you should run calcNhoodExpression(x) with the desired assay.

scale_to_1

A logical scalar to re-scale gene expression values between 0 and 1 for visualisation.

show_rownames

A logical scalar whether to plot rownames or not. Generally useful to set this to show_rownames=FALSE when plotting many genes.

highlight_features

A character vector of feature names that should be highlighted on the right side of the heatmap. Generally useful in conjunction to show_rownames=FALSE, if you are interested in only a few features

grid.space

a character setting the space parameter for facet.grid ('fixed' for equally sized facets, 'free' to adapt the size of facent to number of neighbourhoods in group)

Value

a ggplot object

a ggplot object

Author(s)

Emma Dann

Examples

NULL

NULL


MikeDMorgan/miloR documentation built on Oct. 19, 2024, 8:39 p.m.