changeCtLayout {HTqPCR} | R Documentation

## Changing the dimensions (rows x columns) of qPCRset objects

### Description

A function for splitting up the individual qPCR cards, in case there are multiple samples present on each card. I.e. for cases where the layout isn't 1 sample x 384 features, but for example 4 samples x 96 features on each 384 well card.

### Usage

    changeCtLayout(q, sample.order)

### Arguments

`q` | a qPCRset object.
`sample.order` | vector, same length as number of features on each card (e.g. 384). See details.

### Details

The result from each qPCR run of a given card typically gets presented together, such as in a file with 384 lines, one per feature, for 384 well plates. However, some cards may contain multiple samples, such as commercial cards that are designed to be loaded with two separate samples and then include 192 individual features.

Per default, each card is read into the `qPCRset` object as consisting of a single sample, and hence one column in the Ct data matrix. When this is not the case, the data can subsequently be split into the correct features x samples (rows x columns) dimensions using this function. The parameter `sample.order` is a vector, that for each feature in the `qPCRset` indicates what sample it actually belongs to.

In the new `qPCRset` the samples (Ct columns) are ordered first by `sample.order` then by the original `sampleNames`, as shown in the examples below.

### Value

A qPCRset object like the input, but with the dimensions changed according to the new layout.

### Note

Since the actual biological samples are likely to differ on each card, after applying `changeCtLayout` renaming of the samples in `qPCRset` using `sampleNames` is advisable.

The features are assumed to be identical for all samples on a given card! I.e. if for example `sample.order=rep(c("A", "B"), each=192)`, then feature number 1 (the first for sample A) should be the same as feature number 193 (the first for sample B). The new `featureNames` are taken for those features listed as belonging to the first sample in `sample.order`.

### Author(s)

Heidi Dvinge

### Examples

    # Example data
    data(qPCRraw)
    # With e.g. 2 or 4 samples per 384 well card.
    sample2.order <- rep(c("subSampleA", "subSampleB"), each=192)
    sample4.order <- rep(c("subA", "subB", "subC", "subD"), each=96)
    # Splitting the data into all individual samples
    qPCRnew2 <- changeCtLayout(qPCRraw, sample.order=sample2.order)
    show(qPCRnew2)
    qPCRnew4 <- changeCtLayout(qPCRraw, sample.order=sample4.order)
    show(qPCRnew4)
    sampleNames(qPCRnew4)

[Package HTqPCR version 1.44.0 Index]