Skip to contents

Whole genome copy number plot for one sample with partitioning lines between chromosomes.

Usage

CNSegmentsPlot(
  cnobj,
  sample = NULL,
  copy_number_steps = NULL,
  max_points_to_display = Inf,
  highlight_masks = NULL,
  min_copy_number = NULL,
  max_copy_number = NULL,
  copy_number_breaks = NULL,
  dolog2 = NULL,
  def_point_colour = "black",
  point_alpha = 0.6,
  point_size = 1,
  point_shape = 16,
  segment_colour = "red",
  segment_alpha = 1,
  segment_line_size = 1.5,
  copy_number_step_colour = "blue",
  copy_number_step_alpha = 0.35,
  copy_number_step_line_size = 0.75,
  xlabel = "chromosome",
  ylabel = "copy number"
)

Arguments

cnobj

A QDNAseq object contains copynumber, and segmented assay slots.
This function expects copy-number data that has been segmented. May contain multiple samples.

sample

A character string indicating the sample.
Required if the object passed to cnobj contains data for multiple samples.
Ex. c('sample1')
Must match one of the sample names exactly.

copy_number_steps

a data frame containing absolute_copy_number and copy_number columns.

max_points_to_display

maximum number of copy number points to display (downsampling may be carried out if there are more copy number values than this number).

highlight_masks

A character string indicating any feature data slots containing logical masks over the bins. Each slot will be given its own colour.
Keep in mind that NA values will be filtered out and should masks have overlap the last one will take precedence.
Ex. c('comCNV.mask', 'centro.telo.mask')

min_copy_number

Numeric. The minimum copy_number to display. Effectively controls Y-axis limits.

max_copy_number

Numeric. The maximum copy_number to display. Effectively controls Y-axis limits.

copy_number_breaks

Vector of integers. Breaks at which grid lines will be displayed.
ex. c(1:12)

def_point_colour

A character string indicating the colour for the default copy number points.

point_alpha

Numeric. The transparency of the copy number points.

point_size

The size of the copy number points.

point_shape

The point shape. See the ggplot2::geom_point() docs and the shape parameter for details.

segment_colour

The colour of the copy number segments.

segment_alpha

The transparency of the copy number segments.

segment_line_size

The size of the lines for copy number segments.

copy_number_step_colour

The colour of the copy number step lines.

copy_number_step_alpha

The transparency of the copy number step lines.

copy_number_step_line_size

The size of the lines for the copy number. steps.

xlabel, ylabel

x- and y-axis labels.

Value

A ggplot object.

Details

The copynumber values passed into this function can be on the relative or absolute scales, or be log2 ratios. However, the same scale should be used consistently in each slot of cnobj (and the copy_number_steps dataframe as the case may be).