Visualizes the distribution of values of a set of variables.

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

  • plotDistribution2() Takes a data.frame as the starting point.

plotDistribution(
  object,
  of_sample = "",
  variables,
  method_gs = "mean",
  plot_type = "histogram",
  clrp = "milo",
  binwidth = 0.05,
  ...,
  normalize = TRUE,
  assign = FALSE,
  assign_name,
  verbose = TRUE
)

plotDistribution2(
  df,
  variables = "all",
  plot_type = "histogram",
  clrp = "milo",
  binwidth = 0.05,
  verbose = TRUE,
  ...
)

Arguments

object

A valid spata-object.

of_sample

The sample(s) of interest specified as a single character value or vector. If set to "" (the default) the first sample is chosen.

variables

Character vector. The numeric variables of interest.

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().

plot_type

Character value. One of 'histogram', 'density', 'violin', 'boxplot' and 'ridgeplot'.

binwidth

The binwidth to use if plot_type is specified as 'histogram'.

...

additional arguments to ggplot2::facet_wrap()

normalize

Logical. If set to TRUE values will be scaled to 0-1.

Hint: Variables that are uniformly expressed can not be scaled and are discarded.

assign

Logical. If set to TRUE a named list will be assigned to the global environment. This list contains data and information to rebuild or additionally customize the output plot of this function.

assign_name

The name the assigned list is supposed to have specified as a single character value.

verbose

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

(Warning messages will always be printed.)

df

A data.frame that contains the numeric variables specified in variables.