plotCopyNumbers: plot Copy Numbers from ASCAT-like file

View source: R/plotCopyNumbers.R

plotCopyNumbersR Documentation

plot Copy Numbers from ASCAT-like file

Description

Plot the copy numbers across the Chromosomes. Optionally, plot also highlight regions at the bottom. For example, could be used to highlight HRD-LOH regions.

Usage

plotCopyNumbers(
  sv_df,
  sample_name,
  filename = NULL,
  plottitle = NULL,
  mar = NULL,
  minorCNcolour = "green",
  totalCNcolour = "red",
  outofrangeCNcolour = "purple",
  highlightRegions = NULL,
  highlightText = NULL,
  highlightColour = "brown",
  textscaling = 1,
  genome.v = "hg19"
)

Arguments

sv_df

data frame with the following columns: 'seg_no', 'Chromosome', 'chromStart', 'chromEnd', 'total.copy.number.inNormal', 'minor.copy.number.inNormal', 'total.copy.number.inTumour', 'minor.copy.number.inTumour'

sample_name

sample name

filename

if a file name is specified, a pdf file will be generated

mar

set custom margins, otherwise mar will be set to mar = c(4,4,3,2)

highlightRegions

dataframe with columns 'Chromosome', 'Start', 'End', which specify the regions to highlight. This is optional.

highlightText

if highlightRegions is specified, then highlightText will be plotted in the bottom right

highlightColour

set the colour of the highlight regions and text. Default is brown

Value

returns the HRD-LOH index or regions

Examples

ascat.data <- read.table("ascat.scv",sep=",",header=TRUE)
HRDLOHregions <- ascatToHRDLOH(ascat.df,"test_sample",return.loc=TRUE)
HRDLOHscore <- nrow(HRDLOHregions)
plotCopyNumbers(sv_df = ascat.data,sample_name = "",highlightRegions = HRDLOHregions,
                highlightText = paste0("HRD-LOH\\n",HRDLOHscore))

Nik-Zainal-Group/signature.tools.lib documentation built on April 13, 2025, 5:50 p.m.