Contents

1 1 Background on non-detects in qPCR data

Quantitative real-time PCR (qPCR) measures gene expression for a subset of genes through repeated cycles of sequence-specific DNA amplification and expression measurements. During the exponential amplification phase, each cycle results in an approximate doubling of the quanitity of each target transcript. The threshold cycle (Ct) – the cycle at which the target gene’s expression first exceeds a predetermined threshold – is used to quantify the expression of each target gene. These Ct values typically represent the raw data from a qPCR experiment.

One challenge of qPCR data is the presence of non-detects those reactions failing to attain the expression threshold. While most current software replaces these non-detects with the maximum possible Ct value (typically 40), recent work has shown that this introduces large biases in estimation of both absolute and differential expression. Here, we treat the non-detects as missing data, model the missing data mechanism, and use this model to impute Ct values for the non-detects.

2 2 EM algirithm

We propose the following model of observed expression for gene \(i\), sample-type \(j\), and replicate \(k\), \(Y_{ijk}\): \[Y_{ijk} = \left\{ \begin{array} {rr} \theta_{ij} + \delta_{k} + \epsilon_{ijk} & \textrm{if $Z_{ijk}=1$}\\ \textrm{non-detect} & \textrm{if $Z_{ijk}=0$} \end{array} \right.\]

where \(\delta_{k}\) represents a global shift in expression across samples and, \[ Pr(Z_{ijk}=1) = \left\{ \begin{array} {rr} g(Y_{ijk}) & \textrm{if $Y_{ijk} < 40$} \\ 0 & \textrm{otherwise} \end{array} \right.\]

Here, \(g(Y_{ijk})\) can be estimated via the following logistic regression: \[ logit(Pr(Z_{ijk}=1)) = \beta_0 + \beta_1 median(Y_{ij.}) \] where \(median(Y_{ij.})\) is an estimate of the average expression for gene \(i\) and sample-type \(j\) over \(k\) replicates.

3 3 Example

3.1 Data from Sampson et al. Oncogene 2013

Two cell types – young adult mouse colon (YAMC) cells and mutant-p53/activated-Ras transformed YAMC cells – in combination with three treatments – untreated, sodium butyrate, or valproic acid. Four replicates were performed for each cell-type/treatment combination (E. Sampson et al. 2013).

3.2 Load the data

library(HTqPCR)
## Loading required package: Biobase
## Loading required package: BiocGenerics
## Loading required package: parallel
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
## 
##     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
##     clusterExport, clusterMap, parApply, parCapply, parLapply,
##     parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, as.vector, cbind,
##     colnames, do.call, duplicated, eval, evalq, Filter, Find, get,
##     grep, grepl, intersect, is.unsorted, lapply, lengths, Map,
##     mapply, match, mget, order, paste, pmax, pmax.int, pmin,
##     pmin.int, Position, rank, rbind, Reduce, rownames, sapply,
##     setdiff, sort, table, tapply, union, unique, unlist, unsplit
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## Loading required package: RColorBrewer
## Loading required package: limma
## Warning: package 'limma' was built under R version 3.2.3
## 
## Attaching package: 'limma'
## The following object is masked from 'package:BiocGenerics':
## 
##     plotMA
library(mvtnorm)
library(nondetects)
data(oncogene2013)

3.3 Examine residuals when non-detects are replaced by 40

Normalize to Becn1:

normCt <- normalizeCtData(oncogene2013, norm = "deltaCt", deltaCt.genes = "Becn1")
## Calculating deltaCt values
##  Using control gene(s): Becn1 
##  Card 1: Mean=26.17  Stdev=NA
##  Card 2: Mean=25.5   Stdev=NA
##  Card 3: Mean=25.85  Stdev=NA
##  Card 4: Mean=26.22  Stdev=NA
##  Card 5: Mean=26.59  Stdev=NA
##  Card 6: Mean=25.35  Stdev=NA
##  Card 7: Mean=25.73  Stdev=NA
##  Card 8: Mean=26.36  Stdev=NA
##  Card 9: Mean=26.13  Stdev=NA
##  Card 10:    Mean=25.38  Stdev=NA
##  Card 11:    Mean=25.61  Stdev=NA
##  Card 12:    Mean=26.52  Stdev=NA
##  Card 13:    Mean=26.12  Stdev=NA
##  Card 14:    Mean=26.56  Stdev=NA
##  Card 15:    Mean=26.02  Stdev=NA
##  Card 16:    Mean=25.5   Stdev=NA
##  Card 17:    Mean=25.76  Stdev=NA
##  Card 18:    Mean=26.03  Stdev=NA
##  Card 19:    Mean=26.67  Stdev=NA
##  Card 20:    Mean=26.69  Stdev=NA
##  Card 21:    Mean=26.11  Stdev=NA
##  Card 22:    Mean=25.86  Stdev=NA
##  Card 23:    Mean=26.27  Stdev=NA
##  Card 24:    Mean=26.26  Stdev=NA

Calculate residuals for each set of replicates:

conds <- paste(pData(normCt)$sampleType,pData(normCt)$treatment,sep=":")
resids <- matrix(nrow=nrow(normCt), ncol=ncol(normCt))
for(i in 1:nrow(normCt)){
  for(j in 1:ncol(normCt)){
    ind <- which(conds==conds[j])
    resids[i,j] <- exprs(normCt)[i,j]-mean(exprs(normCt)[i,ind])
  }
}

Create boxplots of residuals stratified by the presence of a non-detect:

iND <- which(featureCategory(normCt)=="Undetermined", arr.ind=TRUE)
iD <- which(featureCategory(normCt)!="Undetermined", arr.ind=TRUE)
boxes <- list("observed"=-resids[iD], "non-detect"=-resids[iND])
boxplot(boxes, main="",ylim=c(-12,12),
        ylab=expression(paste("-",Delta,"Ct residuals",sep="")))


## Impute non-detects

oncogene2013_1 <- qpcrImpute(oncogene2013, 
groupVars=c("sampleType","treatment"), outform = c("Multy"), 
vary_fit=FALSE, vary_model=TRUE, add_noise=TRUE, numsam=2)
## ~0 + nrep
## <environment: 0x0000000016e17380>
## [1] "1 / 100"
## -1586.32350454531
## [1] "2 / 100"
## -1532.33373645459
## [1] "3 / 100"
## -1506.64379697505
## [1] "4 / 100"
## -1494.38792762004
## [1] "5 / 100"
## -1487.58174346804
## [1] "6 / 100"
## -1483.22776877085
## [1] "7 / 100"
## -1480.31128960294
## [1] "8 / 100"
## -1478.31967542131
## [1] "9 / 100"
## -1476.94980050437
## [1] "10 / 100"
## -1475.99499358357
## [1] "Multy"
## vary model= TRUE vary_fit= FALSE add_noise= TRUE
##  creating data set  1 
## 
##  creating data set  2

3.4 Examine residuals when non-detects are replaced by imputed values

Normalize to Becn1:

normCt <- normalizeCtData(oncogene2013_1[[1]], norm = "deltaCt", deltaCt.genes = "Becn1")
## Calculating deltaCt values
##  Using control gene(s): Becn1 
##  Card 1: Mean=26.17  Stdev=NA
##  Card 2: Mean=25.5   Stdev=NA
##  Card 3: Mean=25.85  Stdev=NA
##  Card 4: Mean=26.22  Stdev=NA
##  Card 5: Mean=26.59  Stdev=NA
##  Card 6: Mean=25.35  Stdev=NA
##  Card 7: Mean=25.73  Stdev=NA
##  Card 8: Mean=26.36  Stdev=NA
##  Card 9: Mean=26.13  Stdev=NA
##  Card 10:    Mean=25.38  Stdev=NA
##  Card 11:    Mean=25.61  Stdev=NA
##  Card 12:    Mean=26.52  Stdev=NA
##  Card 13:    Mean=26.12  Stdev=NA
##  Card 14:    Mean=26.56  Stdev=NA
##  Card 15:    Mean=26.02  Stdev=NA
##  Card 16:    Mean=25.5   Stdev=NA
##  Card 17:    Mean=25.76  Stdev=NA
##  Card 18:    Mean=26.03  Stdev=NA
##  Card 19:    Mean=26.67  Stdev=NA
##  Card 20:    Mean=26.69  Stdev=NA
##  Card 21:    Mean=26.11  Stdev=NA
##  Card 22:    Mean=25.86  Stdev=NA
##  Card 23:    Mean=26.27  Stdev=NA
##  Card 24:    Mean=26.26  Stdev=NA

Remove the normalization gene:

normCt <- normCt[-which(featureNames(normCt)=="Becn1"),]

Calculate residuals for each set of replicates:

conds <- paste(pData(normCt)$sampleType,
               pData(normCt)$treatment,sep=":")
resids <- matrix(nrow=nrow(normCt), ncol=ncol(normCt))
for(i in 1:nrow(normCt)){
  for(j in 1:ncol(normCt)){
    ind <- which(conds==conds[j])
    resids[i,j] <- exprs(normCt)[i,j]-mean(exprs(normCt)[i,ind])
  }
}

Create boxplots of residuals stratified by the presence of a non-detect:

iI <- which(featureCategory(normCt)=="Imputed", arr.ind=TRUE)
iD <- which(featureCategory(normCt)!="Imputed", arr.ind=TRUE)
boxes <- list("observed"=-resids[iD], "imputed"=-resids[iI])
boxplot(boxes, main="",ylim=c(-12,12),
        ylab=expression(paste("-",Delta,"Ct residuals",sep="")))


4 Additional examples

Two additional example data sets are used in the paper and included in the package. These are each briefly described below.

4.1 Data from Almudevar et al. SAGMB 2011

Cells transformed to malignancy by mutant p53 and activated Ras are perturbed with the aim of restoring gene expression to levels found in non-transformed parental cells via retrovirus-mediated re-expression of corresponding cDNAs or shRNA-dependent stable knock-down. The data contain 4-6 replicates for each perturbation, and each perturbation has a corresponding control sample in which only the vector has been added (Almudevar et al. 2011).

library(nondetects)
data(sagmb2011)

4.2 Data from McMurray et al. Nature 2008

A study of the effect of p53 and/or Ras mutations on gene expression. The third dataset is a comparison between four cell types – YAMC cells, mutant-p53 YAMC cells, activated-Ras YAMC cells, and p53/Ras double mutant YAMC cells. Three replicates were performed for the untransformed YAMC cells, and four replicates were performed for each of the other cell types (H. R. McMurray et al. 2008).

library(nondetects)
data(nature2008)

5 Funding

This work was supported by National Institutes of Health [grant numbers CA009363, CA138249, HG006853]; and an Edelman-Gardner Foundation Award.

6 Session Info

sessionInfo()
## R version 3.2.2 (2015-08-14)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 8 x64 (build 9200)
## 
## locale:
## [1] LC_COLLATE=English_United States.1252 
## [2] LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
## [1] nondetects_2.0.0    mvtnorm_1.0-3       HTqPCR_1.24.0      
## [4] limma_3.26.5        RColorBrewer_1.1-2  Biobase_2.30.0     
## [7] BiocGenerics_0.16.1 BiocStyle_1.8.0    
## 
## loaded via a namespace (and not attached):
##  [1] knitr_1.12            magrittr_1.5          zlibbioc_1.16.0      
##  [4] stringr_1.0.0         caTools_1.17.1        tools_3.2.2          
##  [7] KernSmooth_2.23-15    affy_1.48.0           htmltools_0.3        
## [10] gtools_3.5.0          yaml_2.1.13           digest_0.6.9         
## [13] preprocessCore_1.32.0 affyio_1.40.0         formatR_1.2.1        
## [16] bitops_1.0-6          evaluate_0.8          rmarkdown_0.9.2      
## [19] gdata_2.17.0          stringi_1.0-1         BiocInstaller_1.20.1 
## [22] gplots_2.17.0         stats4_3.2.2

References

Almudevar, Anthony, Matthew N McCall, Helene McMurray, and Hartmut Land. 2011. “Fitting Boolean Networks from Steady State Perturbation Data.” Statistical Applications in Genetics and Molecular Biology 10 (1). bepress: 47.

McMurray, Helene R, Erik R Sampson, George Compitello, Conan Kinsey, Laurel Newman, Bradley Smith, Shaw-Ree Chen, et al. 2008. “Synergistic Response to Oncogenic Mutations Defines Gene Class Critical to Cancer Phenotype.” Nature 453 (7198). Nature Publishing Group: 1112–16.

Sampson, ER, HR McMurray, DC Hassane, L Newman, P Salzman, CT Jordan, and H Land. 2013. “Gene Signature Critical to Cancer Phenotype as a Paradigm for Anticancer Drug Discovery.” Oncogene 32 (33). Nature Publishing Group: 3809–18.