[Qpcr-commits] r132 - pkg/QCqPCR/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 23 09:54:07 CET 2011
Author: jperkins
Date: 2011-03-23 09:54:06 +0100 (Wed, 23 Mar 2011)
New Revision: 132
Modified:
pkg/QCqPCR/R/PseudoPlot.R
pkg/QCqPCR/R/qPCRPairs.R
Log:
changed the plot functions to make prettier output (following suggestions in Matthias's 1st edit of .tex file)
Modified: pkg/QCqPCR/R/PseudoPlot.R
===================================================================
--- pkg/QCqPCR/R/PseudoPlot.R 2011-03-23 08:51:26 UTC (rev 131)
+++ pkg/QCqPCR/R/PseudoPlot.R 2011-03-23 08:54:06 UTC (rev 132)
@@ -23,12 +23,11 @@
whichPlates <- sort(unique(plateVec))
if(plateToPlot != "AllPlates") whichPlates <- plateToPlot
wellVec <- as.numeric(gsub(".*-", "", orderMat))
-cat("ZZZZ",whichPlates,"here\n")
if (plotType == "Cts.Values") {
minVal <- 0
maxVal <- round(max(ctsMat, na.rm=TRUE), 2)
for (plate in whichPlates) { # for each plate
- plotTitle <- paste(plotType, "for plate:", plate)
+ plotTitle <- paste(gsub("\\."," ",plotType), "for plate:", plate)
orderedVals <- ctsMat[plateVec == plate][order(wellVec[plateVec == plate])]
plotMat <- matrix(orderedVals, nrow=16, byrow=TRUE)
.plotCardRaw(plotMat, plotTitle, minVal, max(plotMat, na.rm=TRUE), writeToFile)
@@ -36,7 +35,7 @@
}
else if (plotType == "Plate.Residuals") {
for (plate in whichPlates) {
- plotTitle <- paste(plotType, "for plate:", plate)
+ plotTitle <- paste(gsub("\\."," ",plotType), "for plate:", plate)
orderedVals <- ctsMat[plateVec == plate][order(wellVec[plateVec == plate])]
if (statType == "parametric") {
plateResidual <- sd(as.vector(orderedVals), na.rm = TRUE)
@@ -63,7 +62,7 @@
valMat <- totalMat / residVec # now divide to get the results in terms of SDs/MADs from mean
valMat[is.na(valMat)] <- 0 # bit cludgey - deals with when we have a 0 / 0 calculations
for (plate in whichPlates) { # now we must order and plot the new values by plate
- plotTitle <- paste(plotType, "for plate:", plate)
+ plotTitle <- paste(gsub("\\."," ",plotType), "for plate:", plate)
orderedVals <- valMat[plateVec == plate][order(wellVec[plateVec == plate])]
plotMat <- matrix(orderedVals, nrow=16, byrow=TRUE)
.plotCardStats(plotMat, plotTitle, writeToFile, statType)
@@ -84,7 +83,7 @@
}
}
for (plate in whichPlates) { # for each plate
- plotTitle <- paste(plotType, "for plate:", plate)
+ plotTitle <- paste(gsub("\\."," ",plotType), "for plate:", plate)
orderedCts <- ctsMat[plateVec == plate][order(wellVec[plateVec == plate])]
totalVec <- orderedCts - averageWell
valMat <- totalVec / residWell
Modified: pkg/QCqPCR/R/qPCRPairs.R
===================================================================
--- pkg/QCqPCR/R/qPCRPairs.R 2011-03-23 08:51:26 UTC (rev 131)
+++ pkg/QCqPCR/R/qPCRPairs.R 2011-03-23 08:54:06 UTC (rev 132)
@@ -9,7 +9,6 @@
pairsToPlot <- combn(sampleNames(qPCRBatch),2)
}
else {
-cat("HEREIHOPE\n")
pairsToPlot <- combn(pairsToPlot,2)
}
plotMat <- exprs(qPCRBatch)
@@ -40,7 +39,6 @@
x <- samples[1]
y <- samples[2]
if (writeToFile) jpeg(filename = paste(x, "_", y, "_Pairs_Plot.jpeg", sep = ""))
-# plotMat <- as.data.frame(exprs(qPCRBatch))
plot(plotMat[, x], plotMat[, y], xlab = x, ylab = y, xlim = c(1, max(plotMat[, x], na.rm=TRUE)), ylim = c(1, max(plotMat[, y], na.rm=TRUE)))
title(main = paste(x, "vs", y, "R^2 = ", cor(plotMat[, x] ,plotMat[, y], use = "complete.obs")))
abline(0, 1)
More information about the Qpcr-commits
mailing list