plotCNV: Plot SCNA landscape as heatmap

Description Usage Arguments Value Examples

View source: R/plotCNV.R

Description

plotCNV is used to plot the segment-level SCNA data into heatmap.

Usage

1
2
3
4
5
6
7
8
plotCNV(
  segDf,
  genomeVersion = "hg38",
  samples = NULL,
  chr = NULL,
  start = NULL,
  end = NULL
)

Arguments

segDf

segment-level SCNA data frame. This is usually the same input as GISTIC2. Make sure that there are these columns "sample", "chromosome", "start", "end", "log2".

genomeVersion

specify the genome version by which SCNA data were generated, should be either 'hg19' or 'hg38'. If genomeVersion is NULL, the no gap will be filled. Default is NULL.

samples

a optional character vector to specify the samples for the plot. If NULL, all the samples will be ploted and ranked as their order in the segDf. Default is NULL.

chr

a optional character vector to specify the chromosomes for the plot. If NULL, the chromosomes in the segDf will be all ploted and ranked as their order in the segDf. Default is NULL.

start

a integer vector specifying the start positions of each chromosome. If NULL, the position will be the begining of the chromosome(s). Default is NULL.

end

a integer vector specifying the end positions of each chromosome. If NULL, the position will be the end of the chromosome(s). Default is NULL.

Value

a ggplot2 plot object

Examples

1
2
3
4
5
hnsccSegfile <- system.file("extdata", "CPTAC3_HNSCC_SCNA_segment_level.tsv", package = "genomicWidgets")
hnsccSegDf <- read.table(hnsccSegfile, header = TRUE)
plotCNV(hnsccSegDf, genomeVersion = 'hg38') #plot the whole CNV landscape for the cohort
plotCNV(hnsccSegDf, genomeVersion = 'hg38', samples = c("C3L-00995","C3L-00977","C3L-00987","C3L-00994")) #plot SCNA heatmap for selected samples 
plotCNV(hnsccSegDf, genomeVersion = 'hg38', samples = c("C3L-00977","C3L-00987","C3L-00994","C3L-00995"), chr=c('1','2','X'), end=c(1000000,2000000,10000000)) #plot SCNA heatmap for selected samples and genomic ranges

bzhanglab/genomicWidgets documentation built on Aug. 21, 2021, 10:49 a.m.