Visualizes the distribution of values of a set of variables for the whole sample across specific subgroups.

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

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

plotDistributionAcross(
  object,
  of_sample = "",
  variables,
  across,
  across_subset = NULL,
  method_gs = "mean",
  plot_type = "violin",
  binwidth = 0.05,
  clrp = "milo",
  ...,
  normalize = TRUE,
  assign = FALSE,
  assign_name,
  verbose = TRUE
)

plotDistributionAcross2(
  df,
  variables = "all",
  across,
  across_subset = NULL,
  plot_type = "violin",
  binwidth = 0.05,
  clrp = "milo",
  ...,
  normalize = TRUE,
  assign = FALSE,
  assign_name,
  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.

across

Character value. The name of the discrete feature-variable of interest.

Hint: Character- or factor- variables are discrete variables. These functionally assign the barcode spots to distinct groups or clusters (e.g. segment or seurat_clusters) whoose properties you might want to compare against each other. Use getFeatureNames() to get an overview of the features variables your spata-object contains.

across_subset

Character vector or NULL. Specify the particular groups or clusters of interest the feature-variable specified in argument across contains. If set to NULL all of them are chosen.

Hint: Use getFeatureValues() to obtain all available groups of a certain feature-variable.

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.

Value