CCF: Calculation of Cancer Cell Fraction (CCF) for SNVs from...

Description Usage Arguments Value Examples

View source: R/ccf.R

Description

CCF function calculates CCF for each variant based on its allele frequency, CNV/ploidy context, cancer cell fraction of reporeted CNVS within variant position and purity of tumor tissue.

Usage

1
2
CCF(sample.mutations, VAF = NULL, ploidy = NULL, CCF_CNV = NULL,
  purity = NULL, correct = TRUE)

Arguments

sample.mutations

Data Frame which should follow MAF format. Columns (with exactly same names) which sample.mutations should have are:

  • VAF variant allele frequncey for reported SNV

  • ploidy (optional, default = 2) ploidy within reoported SNV. For example if SNV is reporeted in Y chromosome and with no CNV in this position, ploidy should be 1. If gender is not known, than recomandation is to to exclude all SNVs with X chromosome.

  • CCF_CNV (optional, default = 1) cancer cell fraction of somatic SNV in region with reported SNV.

  • purity (optional, default = 1) purity for sample in which SNV is reported.

If not provided they need to be specifed as paramiters of the CCF function.

VAF

(optional) integer/numeric value indicating column in sample.mutations representing variant allele frequncey for reported SNV. Default is NULL value (in this case sample.mutations should already have this column)

ploidy

(optional) integer/numeric value indicating column in sample.mutations representing ploidy context of reported SNV. Default is NULL value (in this case sample.mutations should already have this column, or default value of 2 is taken)

CCF_CNV

(optional) integer/numeric value indicating column in sample.mutations representing CCF of CNV which is reportedin region of reported SNV. Default is NULL value (in this case sample.mutations should already have this column, or default value of 1 is taken)

purity

(optional) integer/numeric value indicating column in sample.mutations representing purity of tumor tissue for sample with reported SNV. Default is NULL value (in this case sample.mutations should already have this column, or default value of 1 is taken)

correct

(optional, default = TRUE) Correction to perform on SNVs for which CCF is calculated as larger then 1. This is justifed with rough estimation of VAF values, missing CNVs and violation of mutal exclusivit assumption (two mutatations in same gene/patient are in different cancer frations ). It is recomanted to keep this parameter to TRUE value, othervise unrealistic CCF (> 1) values can be returned for some SNVs.

Value

a data frame with one additional column, giving CCF vlaues for each SNV in intial sample.mutations data frame.

Examples

1
2
3
4
5
6
7
8
# Simulate some VAF, ploidy and CCF_CNV values
df <- data.frame(VAF=runif(100, min=0.05, max=0.75), 
                 ploidy=sample(c(1:4), 100, replace=TRUE, prob=c(0.4,0.9,0.5,0.1)), 
                 CCF_CNV=runif(100, min=0.1,max=1))
df[df$ploidy == 2, 'CCF_CNV'] <- 1
# call CCF function
df2 <- CCF(df)
head(df2)

hanasusak/cDriver documentation built on May 17, 2019, 2:27 p.m.