[BioC] qPCR plates containing multiple samples in HTqPCR

Heidi Dvinge heidi at ebi.ac.uk
Tue Feb 16 23:21:35 CET 2010


Hello Jeremy and Marco,

it seems like you both have very similar cases with qPCR data analysis in
HTqPCR, so I'm writing to you jointly.

If I understand it correctly, you both have qPCR data from 384-well
plates, but your plates are designed to contain multiple samples per card,
i.e. either 192 features x 2 samples or 96 features x 4 samples.

I've made a test version of a function in HTqPCR, changeCtDim(shown below
my message), for splitting such data into e.g. a 96x4 matrix instead of
384x1 for a qPCRset. Note that this is for *after* importing the data with
readCtdata().

This function requires a qPCRset, and a factor with the order of the
samples on the arrays, so that they correspond to the order of
featureNames. An example for 2 or 4 samples per array would be:

> sample2.order	<- factor(rep(c("A", "B"), each=192))
> sample4.order	<- factor(rep(c("A", "B", "C", "D"), each=96))
> data(qPCRraw)
> q2 <- changeCtDim(qPCRraw, sample.order=sample2.order)
> q4 <- changeCtDim(qPCRraw, sample.order=sample4.order)

Depending on the circumstances of your data, you might also want to do
this after normalising within plates and performing other quality
measures, rather than right after reading in the data. However, it should
hopefully make some of the data characterisation as well as the
differential testing simpler, since data from each sample are present in
separate columns.

If this does not work for your data, or if it was something completely
different you had in mind, then please let me know and I'll see what I can
do. If the changeCtDim() functions does what you require, I'll add it to
the next version of HTqPCR.

HTH
\Heidi

# Paste this function into R to run the examples above.
changeCtDim	<- function(q, sample.order) {
	# Split Ct values
	X	<- split(as.data.frame(exprs(q)), sample.order)
	Xnew <- do.call("cbind", X)
	# Split categories
	cats	<- split(as.data.frame(featureCategory(q)), sample.order)
	catsnew <- do.call("cbind", cats)
	# Split flags
	flags <- split(as.data.frame(flag(q)), sample.order)
	flagsnew <- do.call("cbind", flags)
	# Make new qPCRset
	out <- new("qPCRset", exprs=as.matrix(Xnew), flag=flagsnew,
featureCategory=catsnew)
	# Add some extra info (not in matrix or data.frame form)
	sampleNames(out)	<- paste(rep(levels(sample.order), each=n.samples(q)),
sampleNames(q), sep=":")
	featureNames(out)	<- featureNames(q)[as.numeric(sample.order)==1]
	featureType(out)	<- featureType(q)[as.numeric(sample.order)==1]
	featureClass(out)	<- featureClass(q)[as.numeric(sample.order)==1]
	out at history	<- rbind(q at history, capture.output(match.call(changeCtDim)))
	# Return the new object
	out
}


------------------//------------------
Heidi Dvinge

European Bioinformatics Institute
Wellcome Trust Genome Campus
Cambridge, CB10 1SD
heidi at ebi.ac.uk



More information about the Bioconductor mailing list