cnaParamsPlot: Plot CNA parameters to evaluate cell CNAs

View source: R/cnaParamsPlot.R

cnaParamsPlotR Documentation

Plot CNA parameters to evaluate cell CNAs

Description

Plot cells according to their CNA correlation and CNA signal values, and display this as a contour plot. If a "sample" column is provided, the resulting plot will be faceted by sample, with the sample name written in the plot. A "group" column is currently required (suggested to just make a group column with all values the same if there are no real groups annotated).

Usage

cnaParamsPlot(
  data,
  x,
  y,
  group = NULL,
  points = TRUE,
  point.col = "black",
  point.alpha = 0.075,
  point.size = 0.5,
  xlab = "CNA correlation",
  ylab = "CNA signal",
  xlim = NULL,
  ylim = NULL,
  xintercept = NULL,
  yintercept = NULL,
  bins = 30,
  breaks = scales::breaks_pretty(n = 4),
  xbreaks = breaks,
  ybreaks = ggplot2::waiver(),
  contour = TRUE,
  geom = "polygon",
  legend.justification = "right",
  legend.position = "top",
  legend.title = ggplot2::waiver(),
  cols = c("red", "blue"),
  text.size = 16,
  label.hjust = 1.25,
  label.vjust = 1.25,
  label.size = 5,
  ...
)

Arguments

data

data.frame with x (CNA correlations), y (CNA signals), group (e.g. presumed Malignant versus Reference Normal) and (optional) sample columns

x

column name corresponding to x values. Either passed as a string or as an unquoted column name. eg 'x' or x is fine.

y

column name corresponding to y values. Either passed as a string or as an unquoted column name. eg 'y' or y is fine.

group

column name corresponding to groups. Either passed as a string or as an unquoted column name. eg 'group' or group is fine.

points

logical; should cell points be plotted as well as the contour plot? Default: TRUE

point.col

relevant only if points = TRUE. specify point colour. Default: 'black'

point.alpha

relevant only if points = TRUE. specify point transparency. Default: 0.075

point.size

relevant only if points = TRUE. specify point size. Default: 0.5

xlab

x-axis title. Default: 'CNA correlation'

ylab

y-axis title. Default: 'CNA signal'

xlim

x-axis limits. Default: NULL

ylim

y-axis limits. Default: NULL

xintercept

PARAM_DESCRIPTION, Default: NULL

yintercept

PARAM_DESCRIPTION, Default: NULL

bins

number of bins to use for contour levels. Fewer bins averages over more of the data but often results with a 'cleaner' looking contour. Default: 7

breaks

breaks. Default: scales::breaks_pretty(n = 4)

xbreaks

x-axis breaks. Default: breaks

ybreaks

y-axis breaks. Default: ggplot2::waiver()

contour

contour lines as well as filled in contour areas? Default: TRUE

geom

I've only used polygon in this specific function but you can go crazy and try other things. Default: 'polygon'

legend.justification

legend justification. Default: 'right'

legend.position

legend position. set to 'none' if not desired. Default: 'top'

legend.title

legend title Default: ggplot2::waiver()

cols

colours of each group. Note that if more than two groups are present, more colours should be provided than the default two. Default: c("red", "blue")

text.size

base text size. Default: 16

label.hjust

only relevant if sample column in data. Adjust position of geom_text with sample name. Default: 1.25

label.size

only relevant if sample column in data. geom_text label size. Default: 5

...

other arguments passed to ggplot2::facet_wrap(.~sample, ...) if sample column in data.

Value

ggplot2 object

See Also

breaks_pretty waiver,tidyeval,ggplot,aes,geom_point,geom_density_2d,geom_label,scale_continuous,scale_alpha,scale_manual,theme,margin,c("guide_bins", "guide_colourbar", "guide_coloursteps", "guide_legend", "guides", "guides"),guide_legend,facet_wrap


jlaffy/infercna documentation built on Jan. 26, 2024, 11:24 p.m.