correlateTMBvalues: Correlate panel-based TMB values with WES-based TMB values

Description Usage Arguments Value Author(s) Examples

View source: R/correlateTMBvalues.R

Description

This function takes in input TMB values quantified for the same samples from gene panels and from whole exome sequencing datasets and performs correlation analysis. Panel-based TMB values may come from real gene panel sequencing or from a simulated gene panel, generated using the simulatePanel function.

Usage

1
correlateTMBvalues(panel.TMB, WES.TMB, corr.coeff, title.plot)

Arguments

panel.TMB

a numeric vector of length n containing TMB values estimated from a gene panel for n samples

WES.TMB

a numeric vector of length n containing TMB values estimated from whole exome sequencing for n samples

corr.coeff

type of correlation coefficient: "pearson", "kendall" or "spearman"

title.plot

a string describing plot title

Value

Returns a pdf file with correlation plot, the Spearman's correlation coefficient with 95 number of samples.

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Read vcf files containing somatic mutations identified by WES -------------
data(ExampleWESvcfs)

# Read files with WES and gene panel design ---------------------------------
data(ExampleWESdesign)
data(ExamplePaneldesign)

# Filter for gene panel simulation ------------------------------------------
# Remove known cancer mutations
vcfs_NoCancer_ForPanel <- applyFilters(vcfs = ExampleWESvcfs, 
                                       assembly = "hg19", 
                                       design = ExamplePaneldesign, 
                                       remove.cancer = TRUE, 
                                       tsList = NULL, 
                                       variantType = NULL)

# Filter for original WES ---------------------------------------------------
# Filter out synonymous mutations
vcfs_NoSynonymous_WES <- applyFilters(vcfs = ExampleWESvcfs, 
                                      assembly = "hg19", 
                                      design = ExampleWESdesign, 
                                      remove.cancer = FALSE, 
                                      tsList = NULL, 
                                      variantType = c("synonymous"))

# Subset the WES dataset so that it will only contain variants in the regions
# targeted by the panel you want to simulate
SimulatedPanel_NoCancer <- applySimulatePanel(WES = vcfs_NoCancer_ForPanel, 
                                              WES.design = ExampleWESdesign,
                                              panel.design = ExamplePaneldesign, 
                                              assembly = "hg19")

# TMB quantification --------------------------------------------------------
# Perform TMB quantification on the simulated panel
TMBs_SimulatedPanel <- applyTMB(inputForTMB = SimulatedPanel_NoCancer, assembly = "hg19")
# Perform TMB quantification on the original Whole Exome sequencing
TMBs_WES <- applyTMB(inputForTMB = vcfs_NoSynonymous_WES, assembly = "hg19")

# Correlate WES-based and simulated panel-based TMB values ------------------
cor_plot <- correlateTMBvalues(panel.TMB = TMBs_SimulatedPanel$Tot_Number_Mutations, 
                                   WES.TMB = TMBs_WES$Tot_Number_Mutations, 
                                   corr.coeff = "spearman",
                                   title.plot="Correlation panel-based and WES-based TMB")
# Visualize plot of Spearman correlations
print(cor_plot)

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