geom_cnv.Rd
Add CNV Annotation to Coverage Plot.
geom_cnv( cnv.df, bin.col = 3, cn.col = 4, ref.cn = 2, bin.point.color = "grey", bin.point.alpha = 0.6, cn.line.color = "red", ref.line.color = "black", plot.space = 0.1, plot.height = 0.2 )
cnv.df | Dataframe contains copy number information, should contains at least three columns (chr, position, bin value, copy number). |
---|---|
bin.col | Column index for bin value (point). Default: 3. |
cn.col | Column index for copy number (line). Default: 4. |
ref.cn | Reference copy number (ploidy). Default: 2. |
bin.point.color | Point color of bin value. Default: "grey". |
bin.point.alpha | Point alpha of bin value. Default: 0.6. |
cn.line.color | Line color of copy number. Default: "red". |
ref.line.color | Line color of reference copy number (ploidy). Default: "black". |
plot.space | Top and bottom margin. Default: 0.1. |
plot.height | The relative height of contact map to coverage plot. Default: 0.2. |
Plot.
# library(ggcoverage) # library(utils) # library("BSgenome.Hsapiens.UCSC.hg19") # # prepare files # cnv.file <- system.file("extdata", "DNA-seq", "SRR054616_copynumber.txt", package = "ggcoverage") # track.file <- system.file("extdata", "DNA-seq", "SRR054616.bw", package = "ggcoverage") # # read CNV # cnv.df = read.table(file = cnv.file, sep = "\t", header = TRUE) # # load track # track.df = LoadTrackFile(track.file = track.file, format = "bw") # track.df$seqnames = paste0("chr", track.df$seqnames) # # plot # ggcoverage(data = track.df, color = "grey", region = "chr4:1-160000000", # mark.region = NULL, range.position = "out") + # geom_gc(bs.fa.seq=BSgenome.Hsapiens.UCSC.hg19) + # geom_cnv(cnv.df = cnv.df, bin.col = 3, cn.col = 4) + # geom_ideogram(genome = "hg19",plot.space = 0, highlight.centromere = TRUE)