filterCNVs {CNVfilteR}R Documentation

filterCNVs

Description

Identifies those copy number calls that can be filtered

Usage

filterCNVs(
  cnvs.gr,
  vcfs,
  expected.ht.mean = 50,
  expected.dup.ht.mean1 = 33.3,
  expected.dup.ht.mean2 = 66.6,
  sigmoid.c1 = 2,
  sigmoid.c2.vector = c(28, 38.3, 44.7, 55.3, 61.3, 71.3),
  dup.threshold.score = 0.5,
  ht.deletions.threshold = 15,
  verbose = FALSE
)

Arguments

cnvs.gr

GRanges containing CNVs to be filtered. Use loadCNVcalls to load them.

vcfs

List of GRanges containing all variants (SNV/indel) obtaining with the loadVCFs function.

expected.ht.mean

Expected heterozygous SNV/indel allele frequency (defaults to 50)

expected.dup.ht.mean1

Expected heterozygous SNV/indel allele frequency when the variant IS NOT in the same allele than the CNV duplication call. (defaults to 33.3)

expected.dup.ht.mean2

Expected heterozygous SNV/indel allele frequency when the variant IS in the same allele than the CNV duplication call. (defaults to 66.6)

sigmoid.c1

Sigmoid c1 parameter. (defaults to 2)

sigmoid.c2.vector

Vector containing sigmoid c2 parameters for the six sigmoids functions. (defaults to c(28, 38.3, 44.7, 55.3, 61.3, 71.3))

dup.threshold.score

Limit value to decide if a CNV duplication can be filtered or not. A CNV duplication can be filtered if the total score computed from heterozygous variants matching the CNV is equal or greater than dup.threshold.score. (defaults to 0.5)

ht.deletions.threshold

Minimum percentage of heterozygous variants matching a CNV deletion to filter that CNV. (defaults to 15)

verbose

Whether to show information messages. (defaults to TRUE)

Details

Checks all the variants (SNV and optionally INDELs) matching each CNV present in cnvs.gr to decide whether a CNV can be filtered or not. It returns an S3 object with 3 elments: cnvs, variantsForEachCNV and filterParameters. See return section for further details.

A CNV deletion can be filtered if there is at least ht.deletions.threshold A CNV duplication can be filtered if the score is >= dup.threshold.score after computing all heterozygous variants matching the CNV.

If a CNV can be filtered, then the value TRUE is set in the filter column of the cnvs element.

Value

A S3 object with 3 elements:

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
as.data.frame(results$cnvs[results$cnvs$filter == TRUE])



[Package CNVfilteR version 1.0.4 Index]