Plots the results of runCnvAnalysis() in form of a lineplot. Use arguments across and across_subset to visualize CNV differences between subgroups of cluster variables or other grouping variables (e.g. based on histology created with createSpatialSegmentation()).

plotCnvLineplot(
  object,
  across = NULL,
  across_subset = NULL,
  arm_subset = c("p", "q"),
  chrom_subset = 1:22,
  chrom_separate = 1:22,
  chrom_arm_subset = NULL,
  smooth_span = 0.08,
  line_alpha = 0.9,
  line_color = "blue",
  line_size = 1,
  display_ribbon = TRUE,
  ribbon_alpha = 0.25,
  ribbon_fill = "lightgrey",
  vline_alpha = 0.75,
  vline_color = "black",
  vline_size = 0.5,
  vline_type = "dashed",
  summarize_with = "mean",
  nrow = NULL,
  ncol = NULL,
  breaks_y = c(0.9, 0.95, 1, 1.05, 1.1),
  labels_y = breaks_y,
  limits_y = base::range(breaks_y),
  expand_y = ggplot2::waiver(),
  verbose = TRUE,
  ...
)

Arguments

object

An object of class spata2.

across

Character value or NULL. Specifies the grouping variable of interest.

Use getGroupingOptions() to obtain all variable names that group the barcode spots of your object in a certain manner.

across_subset

Character vector or NULL. Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

arm_subset

Character vector. A combination of 'p' and/or 'q'. Denotes which chromosome arms are included. Defaults to both.

chrom_subset

Character or numeric vector. Denotes the chromosomes that are included. Defaults to all 1-22.

chrom_separate

Character or numeric vector. Denotes the chromosomes that are separated from their neighbors by vertical lines. Defaults to all 1-22. If FALSE or NULL, no vertical lines are drawn. Requires display_vlines to be set to TRUE.

chrom_arm_subset

Character vector. Denotes the exact chromosome-arm combinations that are included.

smooth_span

Numeric value. Controls the degree of smoothing. Given to argument span of stats::loess().

line_alpha

Numeric. Affects alpha of main lines of the plot.

line_color

Character. Affects color of the main lines of the plot.

line_size

Numeric. Affects size of the main lines of the plot.

display_ribbon

Logical value. If TRUE, a ribbon is displayed around the main line of the plot visualizing uncertainty using standard deviation.

ribbon_alpha, ribbon_fill

Parameters given to ggplot2::geom_ribbion() that control the appearance of the ribbon around the main line of the plot.

vline_alpha, vline_color, vline_size, vline_type

Parameters given to ggplot2::geom_vline() that control the appearance of vertical lines of the plot.

summarize_with

Character value. Name of the function with which to summarize. Either 'mean' or 'median'.

nrow, ncol

Numeric values or NULL. Used to arrange multiple plots.

breaks_y, labels_y, limits_y, expand_y

Given to the corresponding arguments of ggplot2::scale_y_continuous().

verbose

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

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

Value

A ggplot.