filterCNVs: filterCNVs

Description Usage Arguments Details Value Examples

View source: R/filterCNVs.R

Description

Identifies those copy number calls that can be filtered out

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 = 30,
  verbose = FALSE,
  margin.pct = 10
)

Arguments

cnvs.gr

GRanges containing CNVs to be filtered out. 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 out or not. A CNV duplication can be filtered out if the total score computed from heterozygous variants in the CNV is equal or greater than dup.threshold.score. (defaults to 0.5)

ht.deletions.threshold

Minimum percentage of heterozygous variants falling in a CNV deletion to filter that CNV. (defaults to 30)

verbose

Whether to show information messages. (defaults to TRUE)

margin.pct

Variants in the CNV but close to the ends of the CNV will be ignored. margin.pct defines the percentage of CNV length, located at each CNV limit, where variants will be ignored. For example, for a CNV chr1:1000-2000 and a margin.pct value of 10, variants within chr1:1000-1100 and chr1:1900-2000 will be ignored.

Details

Checks all the variants (SNV and optionally INDELs) in each CNV present in cnvs.gr to decide whether a CNV can be filtered out 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 out if there is at least ht.deletions.threshold A CNV duplication can be filtered out if the score is >= dup.threshold.score after computing all heterozygous variants falling in the CNV.

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

Value

A S3 object with 3 elements:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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])

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