applyFilters: Apply filters on a list of CollapsedVCF objects

Description Usage Arguments Value Author(s) Examples

View source: R/applyFilters.R

Description

This function calls the callFilters() function on each element of a list of CollapsedVCF objects and generates in output a list of lists. Each list corresponds to one input element, and consists in four elements: an object containg variants which passed the filter, a character string describing the applied filter (if any), an object containing the sequencing design and a character string with the name of the sample.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
applyFilters(
  vcfs,
  assembly,
  design,
  vaf.cutoff = 0,
  remove.nonexonic = TRUE,
  remove.cancer = FALSE,
  tsList = NULL,
  variantType = c()
)

Arguments

vcfs

a list of one or more CollapsedVCF object(s)

assembly

human genome assembly: hg19 or hg38

design

a GRanges object containing WES or panel design

vaf.cutoff

minimum value of variant allele frequency accepted

remove.nonexonic

logical value 'TRUE' or 'FALSE' indicating whether or not SNV mapped ouside of exons are to be removed. Default is True

remove.cancer

logical value 'TRUE' or 'FALSE' indicating whether or not to remove cancer variants (variants described in COSMIC and truncating mutations in tumor suppressors)

tsList

path to file containing list of tumor suppressors. If not provided a list of 1217 tumor suppressors from the TSgene2 database (<http://bioinfo.mc.vanderbilt.edu/TSGene/>) is used by default.

variantType

type of variant to remove. Possible values: synonymous, nonsynonymous, frameshift, nonsense, not translated or a combination of them specified in a character vector

Value

Returns a list of lists. Each list include the following elements: a GRanges, CollapsedVCF, data.frame object containing variants passing the filter, a charcater string describing applied filter (if any), a GRanges or character vector with the sequencing design, a character string with the name of the sample.

Author(s)

Laura Fancello

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Read vcf
vcf_files <- list(Horizon5="Horizon5_ExamplePanel.vcf", 
                  HorizonFFPEmild="HorizonFFPEmild_ExamplePanel.vcf")
vcf_files <- lapply(vcf_files
                    , function(x) system.file("extdata", x, package = "TMBleR", mustWork = TRUE))
vcfs <- readVcfFiles(vcfFiles = vcf_files, assembly = "hg19")

## Read design
design <- readDesign(system.file("extdata"
, "ExamplePanel_GeneIDs.txt"
, package = "TMBleR"
, mustWork = TRUE)
, assembly = "hg19"
, ids = "entrezgene_id")

## Apply filter to remove known cancer variants using the default tumor
## suppressors list
vcfs_NoCancer <- applyFilters(vcfs = vcfs
, assembly = "hg19"
, design = design
, remove.cancer = TRUE
, tsList = NULL
, variantType = NULL)

## Apply filter to remove synonymous mutations
vcfs_filtered <- applyFilters(vcfs = vcfs,
                             assembly = "hg19",
                             design = design,
                             remove.cancer = FALSE,
                             tsList = NULL,
                             variantType = "synonymous")

acc-bioinfo/TMBleR documentation built on Dec. 18, 2021, 10:21 p.m.