changeCtLayout: Changing the dimensions (rows x columns) of qPCRset objects

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/changeCtLayout.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

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,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, 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':

    plotMA

Warning message:
In read.dcf(con) :
  URL 'http://bioconductor.org/BiocInstaller.dcf': status was 'Couldn't resolve host name'
An object of class "qPCRset"
Size:  192 features, 12 samples
Feature types:		  
Feature names:		 Gene1 Gene2 Gene3 ...
Feature classes:		  
Feature categories:	 OK, Undetermined 
Sample names:		 subSampleA:sample1 subSampleA:sample2 subSampleA:sample3 ...
An object of class "qPCRset"
Size:  96 features, 24 samples
Feature types:		  
Feature names:		 Gene1 Gene2 Gene3 ...
Feature classes:		  
Feature categories:	 OK, Undetermined 
Sample names:		 subA:sample1 subA:sample2 subA:sample3 ...
 [1] "subA:sample1" "subA:sample2" "subA:sample3" "subA:sample4" "subA:sample5"
 [6] "subA:sample6" "subB:sample1" "subB:sample2" "subB:sample3" "subB:sample4"
[11] "subB:sample5" "subB:sample6" "subC:sample1" "subC:sample2" "subC:sample3"
[16] "subC:sample4" "subC:sample5" "subC:sample6" "subD:sample1" "subD:sample2"
[21] "subD:sample3" "subD:sample4" "subD:sample5" "subD:sample6"

HTqPCR documentation built on Nov. 8, 2020, 6:51 p.m.