Skip to contents

This function is used to represent gain or loss of copy number along the transcriptome. The purpose is then to identify regions carrying anomalies. Note that, even if losses are visualized, the intensity is a positive value.

Usage

cnv_plot_intensity(
  table_cnv,
  chr = NULL,
  what = "gain",
  log_scale = FALSE,
  noise_thresh = 0.075,
  contrib_fun = sum
)

Arguments

table_cnv

DATAFRAME : dataframe (genes x cells) containing CNV. Genes must be in the transcriptome order (no default).

chr

VECTOR : a vector containing the chromosome for each gene. It must be the same length as rownames(table_cnv). If not provided, there will be no chromosome annotation (default to NULL)

what

CHARACTER : either "gain" or "loss" (default to "gain")

log_scale

LOGICAL : either to represent intensity in log scale or not (default to FALSE)

noise_thresh

NUMERIC : a threshold above (or below) which a cell is said to carry an anomaly at a specific region. It is used to compute intensity. Value close to 0 will increase the background. It must be in range(table_cnv). If what = "gain", noise_thresh > 0, and if what = "loss", noise_thresh < 0 (default to 0.075)

contrib_fun

FUNCTION : function to compute cells contribution to CNV. It could be sum, mean... of cells having a value above noise_thresh (default to sum)

Value

An ggplot object

Details

To fill in the curves, use : ggplot2::geom_ribbon(aes(ymin = 0, ymax = value))