limmaCtData: Differentially expressed features with qPCR: limma

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/limmaCtData.R


Function for detecting differentially expressed genes from high-throughput qPCR Ct values, based on the framework from the limma package. Multiple comparisons can be performed, and across more than two groups of samples.


limmaCtData(q, design = NULL, contrasts, sort = TRUE, stringent = TRUE, ndups = 1, spacing = NULL, dupcor, ...)



object of class qPCRset.


matrix, design of the experiment rows corresponding to cards and columns to coefficients to be estimated. See details.


matrix, with columns containing contrasts. See details


boolean, should the output be sorted by adjusted p-values.


boolean, for flagging results as "Undetermined". See details.


integer, the number of times each feature is present on the card.


integer, the spacing between duplicate spots, spacing=1 for consecutive spots


list, the output from duplicateCorrelation. See details.


any other arguments are passed to lmFit,, eBayes or decideTests.


This function is a wrapper for the functions lmFit, (if a contrast matrix is supplied) and eBayes from the limma package. See the help pages for these functions for more information about setting up the design and contrast matrices.

All results are assigned to a category, either "OK" or "Unreliable" depending on the input Ct values. If stringent=TRUE any unreliable or undetermined measurements among technical and biological replicates will result in the final result being "Undetermined". For stringent=FALSE the result will be "OK" unless at least half of the Ct values for a given gene are unreliable/undetermined.

Note that when there are replicated features in the samples, each feature is assumed to be present the same number of times, and with regular spacing between replicates. Reordering the sample by featureNames and setting spacing=1 is recommendable.

If technical sample replicates are available, dupcor can be used. It is a list containing the estimated correlation between replicates. limmaCtData will then take this correlation into account when fitting a model for each gene. It can be calculate using the function duplicateCorrelation. Technical replicates and duplicated spots can't be assessed at the same time though, so if dupcor is used, ndups should be 1.


A list of data.frames, one for each column in design, or for each comparison in contrasts if this matrix is supplied. Each component of the list contains the result of the given comparisons, with one row per gene and has the columns:


Feature IDs.


The unique feature IDs from featurePos of the q object. Useful if replicates are not collapsed, in which case there might be several features with identical names.


The result of the t-test.


The corresponding p.values.


P-values after correcting for multiple testing using the Benjamini-Holm method.


The deltadeltaCt values.


The fold change; 2^(-ddCt).


The average Ct across the test samples for the given comparison.


The average Ct across the reference samples for the given comparison.


The category of the Ct values ("OK", "Undetermined") across the test samples for the given comparison.


The category of the Ct values ("OK", "Undetermined") across the reference samples for the given comparison.

Also, the last item in the list is called "Summary", and it's the result of calling decideTests from limma on the fitted data. This is a data frame with one row per feature and one column per comparison, with down-regulation, no change and up-regulation marked by -1, 0 and 1.


Heidi Dvinge


Smyth, G. K. (2005). Limma: linear models for microarray data. In: Bioinformatics and Computational Biology Solutions using R and Bioconductor. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397–420.

See Also

lmFit, and ebayes for more information about the underlying limma functions. mannwhitneyCtData and ttestCtData for other functions calculating differential expression of Ct data. plotCtRQ, heatmapSig and plotCtSignificance can be used for visualising the results.


# Load example preprocessed data
samples <- read.delim(file.path(system.file("exData", package="HTqPCR"), "files.txt"))
# Define design and contrasts
design <- model.matrix(~0+samples$Treatment)
colnames(design) <- c("Control", "LongStarve", "Starve")
contrasts <- makeContrasts(LongStarve-Control, LongStarve-Starve, Starve-Control, levels=design)
# The actual test
diff.exp <- limmaCtData(qPCRpros, design=design, contrasts=contrasts)
# Some of the results
diff.exp[["LongStarve - Control"]][1:10,]

Example output

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, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,, cbind, colMeans, colSums, colnames,,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax,,
    pmin,, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

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

Attaching package: 'limma'

The following object is masked from 'package:BiocGenerics':


Warning message:
In read.dcf(con) :
  URL '': status was 'Couldn't resolve host name'
    genes feature.pos     t.test      p.value adj.p.value      ddCt
72     72         C24  -8.330294 0.0004927066  0.06306645 -8.320716
251   251         K11 -10.426733 0.0001758778  0.06306645 -6.569095
334   334         N22  -8.348398 0.0004878740  0.06306645 -6.621950
336   336         N24   7.383109 0.0008489351  0.08149777  7.379072
39     39         B15  -5.903588 0.0022683881  0.10675037 -4.725538
81     81          D9   5.499021 0.0030725811  0.10675037  3.426818
179   179         H11  -5.649779 0.0027386455  0.10675037 -8.172282
215   215         I23   5.581700 0.0028838373  0.10675037  4.578011
239   239         J23   5.497746 0.0030756048  0.10675037  4.073680
275   275         L11  -5.393175 0.0033359489  0.10675037 -5.371722
              FC meanTarget meanCalibrator categoryTarget categoryCalibrator
72  319.73136471   26.61973       34.94045             OK       Undetermined
251  94.94992769   28.37136       34.94045             OK       Undetermined
334  98.49306439   23.84328       30.46523             OK                 OK
336   0.00600728   33.86877       26.48970   Undetermined                 OK
39   26.45627766   26.00632       30.73186             OK                 OK
81    0.09298760   29.01259       25.58577             OK                 OK
179 288.47095911   25.42994       33.60223             OK       Undetermined
215   0.04186793   31.23535       26.65734             OK                 OK
239   0.05938819   31.02263       26.94895             OK                 OK
275  41.40466997   28.40260       33.77432             OK       Undetermined

HTqPCR documentation built on Nov. 1, 2018, 2:23 a.m.