pcr_test: Statistical testing of PCR data

Description Usage Arguments Details Value References Examples

View source: R/testing_fun.R

Description

A unified interface to different statistical significance tests for qPCR data

Usage

1
pcr_test(df, test = "t.test", ...)

Arguments

df

A data.frame of C_T values with genes in the columns and samples in rows rows

test

A character string; 't.test' default, 'wilcox.test' or 'lm'

...

Other arguments for the testing methods

Details

The simple t-test can be used to test the significance of the difference between two conditions Δ C_T. t-test assumes in addition, that the input C_T values are normally distributed and the variance between conditions are comparable. Wilcoxon test can be used when sample size is small and those two last assumptions are hard to achieve.

Two use the linear regression here. A null hypothesis is formulated as following,

C_{T, target, treatment} - C_{T, control, treatment} = C_{T, target, control} - C_{T, control, control} \quad \textrm{or} \quad ΔΔ C_T

This is exactly the ΔΔ C_T as explained earlier. So the ΔΔ C_T is estimated and the null is rejected when ΔΔ C_T \ne 0.

Value

A data.frame of 5 columns in addition to term when test == 'lm'

For details about the test methods themselves and different parameters, consult t.test, wilcox.test and lm

References

Yuan, Joshua S, Ann Reed, Feng Chen, and Neal Stewart. 2006. “Statistical Analysis of Real-Time PCR Data.” BMC Bioinformatics 7 (85). BioMed Central. doi:10.1186/1471-2105-7-85.

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# locate and read data
fl <- system.file('extdata', 'ct4.csv', package = 'pcr')
ct4 <- read.csv(fl)

# make group variable
group <- rep(c('control', 'treatment'), each = 12)

# test using t-test
pcr_test(ct4,
         group_var = group,
         reference_gene = 'ref',
         reference_group = 'control',
         test = 't.test')

# test using wilcox.test
pcr_test(ct4,
         group_var = group,
         reference_gene = 'ref',
         reference_group = 'control',
         test = 'wilcox.test')

# testing using lm
pcr_test(ct4,
         group_var = group,
         reference_gene = 'ref',
         reference_group = 'control',
         test = 'lm')

# testing advanced designs using a model matrix
# make a model matrix
group <- relevel(factor(group), ref = 'control')
dose <- rep(c(100, 80, 60, 40), each = 3, times = 2)
mm <- model.matrix(~group:dose, data = data.frame(group, dose))

# test using lm
pcr_test(ct4,
         reference_gene = 'ref',
         model_matrix = mm,
         test = 'lm')

# using linear models to check the effect of RNA quality
# make a model matrix
group <- relevel(factor(group), ref = 'control')
set.seed(1234)
quality <- scale(rnorm(n = 24, mean = 1.9, sd = .1))
mm <- model.matrix(~group + group:quality, data = data.frame(group, quality))

# testing using lm
pcr_test(ct4,
         reference_gene = 'ref',
         model_matrix = mm,
         test = 'lm')

# using linear model to check the effects of mixing separate runs
# make a model matrix
group <- relevel(factor(group), ref = 'control')
run <- factor(rep(c(1:3), 8))
mm <- model.matrix(~group + group:run, data = data.frame(group, run))

# test using lm
pcr_test(ct4,
         reference_gene = 'ref',
         model_matrix = mm,
         test = 'lm')

pcr documentation built on April 1, 2020, 9:07 a.m.