plotVariantsForCNV: plotVariantsForCNV

Description Usage Arguments Value Examples

View source: R/plotVariantsForCNV.R

Description

Plots a CNV with all the variants in it

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
plotVariantsForCNV(
  cnvfilter.results,
  cnv.id,
  points.cex = 1,
  points.pch = 19,
  legend.x.pos = 0.08,
  legend.y.pos = 0.25,
  legend.cex = 0.8,
  karyotype.cex = 1,
  cnv.label.cex = 1,
  x.axis.bases.cex = 0.7,
  x.axis.bases.digits = 5,
  y.axis.title.cex = 0.8,
  y.axis.label.cex = 0.8,
  cnv.zoom.margin = TRUE
)

Arguments

cnvfilter.results

S3 object returned by filterCNVs function

cnv.id

CNV id for which to plot variants

points.cex

Points cex (size). (Defaults to 1)

points.pch

Points pch (symbol). (Defaults to 19)

legend.x.pos

Legend x position. (Defaults to 0.08)

legend.y.pos

Legend y position. (Defaults to 0.25)

legend.cex

Legend cex. (Defaults to 0.8)

karyotype.cex

karyotype cex: affects top title and chromosome text (at bottom). (Defaults to 1)

cnv.label.cex

"CNV" text cex. (Defaults to 1)

x.axis.bases.cex

X-axis bases position cex. (Defaults to 0.7)

x.axis.bases.digits

X-axis bases position number of digits. (Defaults to 5)

y.axis.title.cex

Y-axis title cex. (Defaults to 0.8)

y.axis.label.cex

Y-axis labels cex. (Defaults to 0.8)

cnv.zoom.margin

If TRUE, the zoom leaves an small margin at both sides of the CNV. False otherwise. (Defaults to TRUE)

Value

invisibly returns a karyoplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Load CNVs data
cnvs.file <- system.file("extdata", "DECoN.CNVcalls.csv", package = "CNVfilteR", mustWork = TRUE)
cnvs.gr <- loadCNVcalls(cnvs.file = cnvs.file, chr.column = "Chromosome", start.column = "Start", end.column = "End", cnv.column = "CNV.type", sample.column = "Sample")

# Load VCFs data
vcf.files <- c(system.file("extdata", "variants.sample1.vcf.gz", package = "CNVfilteR", mustWork = TRUE),
               system.file("extdata", "variants.sample2.vcf.gz", package = "CNVfilteR", mustWork = TRUE))
vcfs <- loadVCFs(vcf.files, cnvs.gr = cnvs.gr)

# Filter CNVs
results <- filterCNVs(cnvs.gr, vcfs)

# Check CNVs that can be filtered out
as.data.frame(results$cnvs[results$cnvs$filter == TRUE])

# Plot one of them
plotVariantsForCNV(results, "3")

CNVfilteR documentation built on April 17, 2021, 6:06 p.m.