visualize_genes: This function visualizes the results of the clustering and...

Description Usage Arguments Value

View source: R/visualize_genes.R

Description

This function visualizes the results of the clustering and analysis using spatial plots and heatmaps

Usage

1
2
3
4
5
6
7
8
9
visualize_genes(
  counts,
  ids,
  img = NULL,
  clustering,
  genelist,
  filepath = NULL,
  plot.params = list(nx = 35, ny = 33, ox = 0, oy = 0)
)

Arguments

counts

non-negative numeric matrix containing gene counts, rows correspond to spots, columns correspond to genes

ids

data frame or matrix assigning spatial coordinates to the spots

img

image of ST slide, read using EBImage::readImage()

clustering

numeric vector, same order as rownames(counts), assigning each spot a cluster

genelist

data frame containing genes of interest (e.g. output of filter_genes)

filepath

character, directory in which to save plots; if not specified, plots will not be saved to disk

plot.params

plotting parameters as returned by plot_adjustment()

Value

list containing 4 plots (ggplot objects):

  1. spatial.cluster - overlay of clustering on ST image if image was supplied; NULL otherwise

  2. spatial.cluster.legend - spatial clustering, without ST image in background, but with legend

  3. heatmap.plt - simplified heatmap, depicting mean expression of all interesting genes in the different clusters

  4. heatmap.full.plt - heatmap visualizing expression of all interesting genes in all spots


tmirus/TTT documentation built on April 17, 2021, 11:04 p.m.