applyTMB.Rd
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)
inputForTMB | a |
---|---|
assembly | human genome assembly: hg19 or hg38 |
Returns a data.frame with sample, filter, sequencing size, total number of mutations and number of mutations per megabase.
Laura Fancello
## 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")#>#> $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 #> #>#>## Read design design <- readDesign(system.file("extdata" , "ExamplePanel_GeneIDs.txt" , package = "TMBleR" , mustWork = TRUE) , assembly = "hg19" , ids = "entrezgene_id")#>## 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")