Takes four gene sets and visualizes the relative expression of these four gene sets for every barcode by computing it's respective x- and y- coordinates in the state plot. (See details.)

  • plotFourStates() Takes the spata-object as the starting point and creates the necessary data.frame from scratch according to additional parameters.

  • plotFourStates2() Takes a data.frame as input.

plotFourStates(
  object,
  states,
  color_by = NULL,
  method_gs = NULL,
  average_genes = NULL,
  pt_alpha = NULL,
  pt_clrp = NULL,
  pt_clrsp = NULL,
  pt_size = NULL,
  display_labels = NULL,
  verbose = NULL,
  of_sample = NA
)

plotFourStates2(
  data,
  states,
  color_by = NULL,
  pt_size = 1.5,
  pt_alpha = 0.9,
  pt_clrsp = "inferno",
  pt_clrp = "milo",
  display_labels = TRUE
)

Arguments

object

An object of class spata2.

states

The gene sets defining the four states specified as a character vector of length 4.

color_by

The variable to be displayed by color:

  • Gene set as a single character value. Must be in getGeneSets()

  • Genes as a character vector. If more than one gene is specified the average expression of those genes will be calculated and displayed. Must be in getGenes()

  • Feature as a single character value. Must be in getFeaturenNames()

method_gs

Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().

pt_alpha

Numeric value. Specifies the degree of transparency of all points.

pt_clrp

The color palette to be used if the specified variable displayed by color is categorical/discrete. Run validColorPalettes() to see valid input.

pt_clrsp

The color spectrum to be used if the specified variable displayed by color is continuous. Run validColorSpectra() to see valid input.

pt_size

Numeric value. Specifies the size of all points.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

data

A data.frame containing at least the variables barcodes, states.. Whereby the states-variables contain the respective expression values of the specified gene sets.

Value

Returns a ggplot-object that can be additionally customized according to the rules of the ggplot2-framework.