Learn R Programming

HTqPCR (version 1.26.0)

plotCtVariation: Plot variation in Ct values across replicates

Description

Examine the variation in Ct values, either across features present multiple times on each card, or for within different groups of samples. The function supports both a summarised and a more detailed output.

Usage

plotCtVariation(q, cards = TRUE, variation = "var", type = "summary", sample.reps, feature.reps, log = FALSE, add.featurenames = FALSE, ylab, n.col, ...)

Arguments

q
object of class qPCRset.
cards
vector, the numbers of the cards to plot. Defaults to TRUE = all cards.
variation
character string indication whether to calculate the variation, "var", or standard deviation, "sd".
type
character string indicating whether to output the results in a summarised boxplot, "summary" or as a more detailed scatter plot, "detail". See Details and the examples.
sample.reps
a vector grouping the samples (see Details). Overrides feature.reps.
feature.reps
a vector grouping the features according to which are replicates. Per default featureNames(q) are used.
log
logical, should the results be converted into log10 values.
add.featurenames
logical, if type="detail" should the names of each feature be added to the scatter plot.
ylab
character, the label of the y-axis.
n.col
integer, if type="detail" how many columns should the scatterplots be presented in. Defaults to 3, or n.samples(q) if
...
further arguments passed to boxplot or plot.

Value

Details

It is often useful to examine the data to determine if some samples are inherently more variable than other, or if the concordance between replicates on each qPCR card is acceptable. Using type="summary" generates a boxplot with all the variation values, either across genes (if sample.reps is set) or with each samples (default, or if feature.reps is set). That way the general distribution of variation or standard deviation values can be compared quickly. If it looks like there's an unacceptable (or interesting) difference in the variation, this can be further investigated using type="detail". This will generate multiple sub-plots, containing a single scatterplot of variation versus mean for each gene (if sample.reps is set) or each sample (default, or if feature.reps is set). Including the mean in the plot can be used to assess heteroskedasticity in the data.

See Also

plotCtReps for cases where the qPCR card only contains two replicates of each feature. plotCVBoxes for other ways of plotting variation within different groups.

Examples

Run this code

# Load some example data
data(qPCRraw)

# Get a summary of the standard deviation across replicated features
plotCtVariation(qPCRraw, variation="sd", log=TRUE)
# Summary of the first 40 genes, assuming there are 3 groups of samples
plotCtVariation(qPCRraw[1:40,], sample.reps=rep(1:2,3))

# Detailed summary of variation versus mean Ct value for replicated features within each sample
plotCtVariation(qPCRraw, type="detail", log=TRUE)
plotCtVariation(qPCRraw, type="detail")
# Add feature names to see which the highly varying replicates are. 
plotCtVariation(qPCRraw, type="detail", add.featurenames=TRUE, pch=" ", cex=0.8)
# Use different information to indicate which features are replicates
plotCtVariation(qPCRraw, type="detail", feature.reps=paste("test", rep(1:96, each=4)))
# Examine variation across samples for the first 9 features
plotCtVariation(qPCRraw[1:9,], type="detail", sample.reps=paste("mutant", rep(1:3,2)), add.featurenames=TRUE)

# Examine the output
test	<- plotCtVariation(qPCRraw, variation="sd")
names(test)
head(test[["Var"]])

Run the code above in your browser using DataLab