plotVariantsForCNV: plotVariantsForCNV

View source: R/plotVariantsForCNV.R

plotVariantsForCNVR Documentation

plotVariantsForCNV

Description

Plots a CNV with all the variants in it

Usage

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,
  legend.text.width = NULL,
  legend.show = TRUE,
  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)

legend.text.width

Legend text width (Defaults to NULL)

legend.show

Whether to show the legend (Defaults to TRUE)

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

# 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")



jpuntomarcos/CNVfilteR documentation built on Oct. 6, 2023, 12:37 a.m.