plotCNV: plot copy number profile

View source: R/plotCNV.R

plotCNVR Documentation

plot copy number profile

Description

plot copy number profile

Usage

plotCNV(
  x,
  frag_obj_mut = NULL,
  gene_to_highlight = list(ENTREZID = NULL, ENSEMBL = NULL, SYMBOL = c("BRAF")),
  genome = "hg19",
  ylim = c(-2, 2),
  chromosome = c(seq(1, 22, 1), "X"),
  point_color = c(Loss = "royalblue", Deletion = "darkblue", Neutral = "darkgrey",
    Amplification = "darkorange", Gain = "orange3"),
  x_title = "Chromosome",
  y_title = "Log2 Ratio",
  point_size = 0.3,
  point_alpha = 0.9,
  chr_edge_color = "black",
  chr_edge_line_size = 0.2,
  chr_edge_alpha = 0.8,
  chr_edge_type = "dotted",
  segment_color = "red",
  segment_alpha = 1,
  segment_line_end = "round",
  segment_line_size = 0.75,
  legend_position = "none",
  x_axis_expand = c(0.1, 0.1),
  y_axis_expand = c(0, 0),
  text_size = 1.6,
  output_file,
  ggsave_params = list(width = 16, height = 4, unit = "cm", dpi = 900),
  ...
)

Arguments

x

QDNAseqCopyNumbers object.

frag_obj_mut

GRanges, optional. A GRanges object containing annotated mutation locus information. If provided, it annotates selected genes with counts of reference and mutant base fragments for specific SNVs within those regions. For detailed analysis instructions and generating a GRanges object, see the 'readBam()' function.

gene_to_highlight

A named list.

genome

string. hg19 or hg38.

ylim

vector. default is c(-2, 2).

chromosome

vector. default is c(seq(1, 22, 1), "X").

point_color

named vector.

x_title

string.

y_title

string.

point_size

numerical. default is 0.3.

point_alpha

numerical. default is 0.9.

chr_edge_color

string. default is "black".

chr_edge_line_size

numerical. default is 0.2.

chr_edge_alpha

numerical. default is 0.8.

chr_edge_type

string. default is "dotted".

segment_color

string. default is "red".

segment_alpha

numerical. default is 1.

segment_line_end

string. default is "round".

segment_line_size

numerical. default is 0.75.

legend_position

string. default is "none", which mean no legends.

x_axis_expand

numerical vector. default is c(0.1, 0.1).

y_axis_expand

numerical vector. default is c(0, 0).

output_file

string, optional Full path and filename for the output plot, including the file extension like ".png" or ".pdf". Ensure the directory exists and is writable.

ggsave_params

A list of parameters to be passed to ggplot2::ggsave(). This list can include any of the arguments that 'ggsave()' accepts. Default settings of 'ggsave()' will be used unless specified. Example: 'list(width = 10, height = 8, dpi = 300)'

...

Other params to geom_txt_repel()

Value

This function returns ggplot2 object.

Author(s)

Haichao Wang, Paulius D. Mennea

Examples

## Not run: 

p <- plotCNV(bamfile = "/path/to/bamfile.bam")

## End(Not run)


hw538/cfDNAPro documentation built on Feb. 17, 2025, 6:09 p.m.