This function reads in input a list (or a list of lists), with sample name, filter description, sn object containing sequencing design and an object containing variants. It quantifies TMB based on these variants and generates in output a text file containing TMB values and a pdf file with a barplot visualization.

applyTMB(inputForTMB, assembly)

Arguments

inputForTMB

a list of lists with the following elements: sample name, filter description, design and a CollapsedVCF or data.frame object containing somatic variants

assembly

human genome assembly: hg19 or hg38

Value

Returns a data.frame with sample, filter, sequencing size, total number of mutations and number of mutations per megabase.

Author

Laura Fancello

Examples

## 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")
#> Validate VCF input:
#> $Horizon5 #> $Horizon5$warnings #> [1] "line 141: The VCF file contains 2 samples. Only the first (1_20170317_01_i01_0_horizon_5) will be used" #> [2] "line 142: AF is described both in FORMAT and in INFO of this and possibly other variants. FORMAT's AF will be used" #> #> $Horizon5$errors #> NULL #> #> #> $HorizonFFPEmild #> $HorizonFFPEmild$warnings #> [1] "line 141: The VCF file contains 2 samples. Only the first (2_20170317_01_i01_0_horizon_ffpe_mild) will be used" #> [2] "line 142: AF is described both in FORMAT and in INFO of this and possibly other variants. FORMAT's AF will be used" #> #> $HorizonFFPEmild$errors #> NULL #> #>
#> Warnings and Errors exported to 'validator_check' variable
## Read design design <- readDesign(system.file("extdata" , "ExamplePanel_GeneIDs.txt" , package = "TMBleR" , mustWork = TRUE) , assembly = "hg19" , ids = "entrezgene_id")
#> Cache found
## Prepare data for TMB quantification, formatting it as required by the ## applyTMB() function. While this is done automatically within the ## applyFilters() function, on a non filtered vcf we need to use the function ## here described to get the correct format vcfs_nonfiltered <- applyFilters(vcfs = vcfs, design = design, assembly = "hg19") ## Perform TMB quantification TMB_res=applyTMB(inputForTMB = vcfs_nonfiltered, assembly = "hg19")