# read in the data
path <- system.file("exData", package = "NormqPCR")
taqman.example <- file.path(path, "example.txt")
qPCRBatch.taqman <- read.taqman(taqman.example)
exprs(qPCRBatch.taqman)["Ccl20.Rn00570287_m1",] # values before
# make contrastM
a <- c(0,0,1,1,0,0,1,1) # one for each sample type, with 1 representing
b <- c(1,1,0,0,1,1,0,0) # position of sample type in the samplenames vector
contM <- cbind(a,b)
colnames(contM) <- c("case","control") # then give the names of each sample type
rownames(contM) <- sampleNames(qPCRBatch.taqman) # and the rows of the matrix
contM
# make sampleMaxM
sMaxM <- t(as.matrix(c(3,3))) # now make the sample max matrix
colnames(sMaxM) <- c("case","control") # make sure these line up with samples
sMaxM
# function
qPCRBatch.taqman.replaced <- makeAllNAs(qPCRBatch.taqman, contM, sMaxM)
exprs(qPCRBatch.taqman.replaced)["Ccl20.Rn00570287_m1",]
Run the code above in your browser using DataLab