plotCtVariation {HTqPCR} | R Documentation

## 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 <3.
`...` | further arguments passed to `boxplot` or `plot`.

### 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.

### Value

A plot is created on the current graphics device. The variation and mean across each type of replicate is returned invisibly in a list with "Var" and "Mean" slots.

### Author(s)

Heidi Dvinge

### 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

    # Load some example data
    data(qPCRraw)

    # 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"]])

[Package HTqPCR version 1.44.0 Index]