[Qpcr-commits] r96 - pkg/NormqPCR/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 25 19:34:09 CET 2010


Author: jperkins
Date: 2010-02-25 19:34:09 +0100 (Thu, 25 Feb 2010)
New Revision: 96

Removed:
   pkg/NormqPCR/R/dealWithUndetermined.R
   pkg/NormqPCR/R/normByHKG.R
Modified:
   pkg/NormqPCR/R/combineTechReps.R
   pkg/NormqPCR/R/deltaDeltaAvgCt.R
   pkg/NormqPCR/R/deltaDeltaCt.R
Log:
general updating


Modified: pkg/NormqPCR/R/combineTechReps.R
===================================================================
--- pkg/NormqPCR/R/combineTechReps.R	2010-02-25 18:20:36 UTC (rev 95)
+++ pkg/NormqPCR/R/combineTechReps.R	2010-02-25 18:34:09 UTC (rev 96)
@@ -15,6 +15,8 @@
       dValues <- as.numeric(apply(expM[grepl(detector, origDetectors),],2,mean,na.rm=TRUE))
       NewExpM[detector,] <- dValues
     }
+    NewExpM[is.na(NewExpM)] <- NA
     qPCRBatch <- new("qPCRBatch", exprs = NewExpM, phenoData = phenoData(qPCRBatch))
+    return(qPCRBatch)
   }
 )

Deleted: pkg/NormqPCR/R/dealWithUndetermined.R
===================================================================
--- pkg/NormqPCR/R/dealWithUndetermined.R	2010-02-25 18:20:36 UTC (rev 95)
+++ pkg/NormqPCR/R/dealWithUndetermined.R	2010-02-25 18:34:09 UTC (rev 96)
@@ -1,21 +0,0 @@
-setGeneric("replaceNAs",
-  function(qPCRBatch, newNA=40)
-  standardGeneric("replaceNAs")
-)
-setMethod("replaceNAs", signature = "qPCRBatch", definition =
-  function(qPCRBatch, newNA) {
-    exprs(qPCRBatch)[is.na(exprs(qPCRBatch))] <- newNA
-    return(qPCRBatch)
-  }
-)
-
-setGeneric("replaceAboveCutOff",
-  function(qPCRBatch, newVal=NA, cutOff=38)
-  standardGeneric("replaceAboveCutOff")
-)
-setMethod("replaceAboveCutOff", signature = "qPCRBatch", definition =
-  function(qPCRBatch, newVal, cutOff) {
-    exprs(qPCRBatch)[exprs(qPCRBatch) > cutOff] <- newVal
-    return(qPCRBatch)
-  }
-)

Modified: pkg/NormqPCR/R/deltaDeltaAvgCt.R
===================================================================
--- pkg/NormqPCR/R/deltaDeltaAvgCt.R	2010-02-25 18:20:36 UTC (rev 95)
+++ pkg/NormqPCR/R/deltaDeltaAvgCt.R	2010-02-25 18:34:09 UTC (rev 96)
@@ -23,8 +23,8 @@
       sdHkgControl <- NA
     }
     else {
-      meanHkgCase <- geomMean(hkgVCase, na.rm=TRUE)
-      meanHkgControl <- geomMean(hkgVControl, na.rm=TRUE)
+      meanHkgCase <- mean(hkgVCase, na.rm=TRUE)
+      meanHkgControl <- mean(hkgVControl, na.rm=TRUE)
       sdHkgCase <- sd(hkgVCase, na.rm=TRUE)
       sdHkgControl <- sd(hkgVControl, na.rm=TRUE)
     }
@@ -38,8 +38,8 @@
     for (detector in featureNames(qPCRBatch)) {
           VCase <- caseM[detector,]
           VControl <- controlM[detector,]
-          meanCase <- geomMean(VCase, na.rm=TRUE)
-          meanControl <- geomMean(VControl, na.rm=TRUE)
+          meanCase <- mean(VCase, na.rm=TRUE)
+          meanControl <- mean(VControl, na.rm=TRUE)
           sdCase <- sd(VCase, na.rm=TRUE)
           sdControl <- sd(VControl, na.rm=TRUE)
 
@@ -48,7 +48,7 @@
           sdCase <- NA
         }
         else {
-          meanCase <- geomMean(VCase, na.rm=TRUE)
+          meanCase <- mean(VCase, na.rm=TRUE)
           sdCase <- sd(VCase, na.rm=TRUE)
         }
         if(sum(is.na(VControl)) > maxNAControl) {
@@ -56,7 +56,7 @@
           sdControl <- NA
         }
         else {
-          meanControl <- geomMean(VControl, na.rm=TRUE)
+          meanControl <- mean(VControl, na.rm=TRUE)
           sdControl <- sd(VControl, na.rm=TRUE)
         }
         dCtCase <- meanCase - meanHkgCase

Modified: pkg/NormqPCR/R/deltaDeltaCt.R
===================================================================
--- pkg/NormqPCR/R/deltaDeltaCt.R	2010-02-25 18:20:36 UTC (rev 95)
+++ pkg/NormqPCR/R/deltaDeltaCt.R	2010-02-25 18:34:09 UTC (rev 96)
@@ -33,7 +33,7 @@
           sdCase <- NA
         }
         else {
-          dCtCase <- geomMean(VCase - hkgVCase, na.rm=TRUE)
+          dCtCase <- mean(VCase - hkgVCase, na.rm=TRUE)
           sdCase <- sd(VCase - hkgVCase, na.rm=TRUE)
         }
         if(length(VControl) == 1) {
@@ -41,7 +41,7 @@
           dCtControl <- VControl
         }
         else {
-          dCtControl <- geomMean(VControl - hkgVControl, na.rm=TRUE)
+          dCtControl <- mean(VControl - hkgVControl, na.rm=TRUE)
         }
         if(sum(is.na(VCase)) > maxNACase) {
           dCtCase <- NA

Deleted: pkg/NormqPCR/R/normByHKG.R
===================================================================
--- pkg/NormqPCR/R/normByHKG.R	2010-02-25 18:20:36 UTC (rev 95)
+++ pkg/NormqPCR/R/normByHKG.R	2010-02-25 18:34:09 UTC (rev 96)
@@ -1,9 +0,0 @@
-normByHkg <- function(qPCRSet, hkg, verbose = FALSE){ # takes qPCRSet and HKG
-  hkg <- make.names(hkg)
-  if(hkg %in% featureNames(qPCRSet) == FALSE) stop (hkg," not found in file. Ensure entered housekeeping genes appear in the file")  
-  hkgCts <- as.numeric(exprs(qPCRSet[hkg,]))
-  if(sum(is.na(hkgCts)) > 0) warning(hkg, " May be a bad housekeeping gene to normalise with since it did not produce a reading ", sum(is.na(hkgCts)), "times out of", length(hkgCts), ".")
-#hkg <- gsub("-.+$","",hkg) # regexp to remove any rubbish from end of control gene spec
-  exprs(qPCRSet) = t(t(exprs(qPCRSet)) - hkgCts)
-  return(qPCRSet)
-}



More information about the Qpcr-commits mailing list