[Qpcr-commits] r99 - in pkg/NormqPCR: . R data inst/doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 17 20:05:13 CET 2010


Author: jperkins
Date: 2010-03-17 20:05:12 +0100 (Wed, 17 Mar 2010)
New Revision: 99

Added:
   pkg/NormqPCR/data/Bladder.qPCRBatch.RData
   pkg/NormqPCR/data/Colon.qPCRBatch.RData
   pkg/NormqPCR/man/Bladder.qPCRBatch.Rd
   pkg/NormqPCR/man/Colon.qPCRBatch.Rd
   pkg/NormqPCR/man/combineTechReps.Rd
   pkg/NormqPCR/man/deltaCt.Rd
   pkg/NormqPCR/man/makeAllNAs.Rd
   pkg/NormqPCR/man/replaceAboveCutOff.Rd
   pkg/NormqPCR/man/replaceNAs.Rd
Removed:
   pkg/NormqPCR/data/Bladder.qPCRBatch.RData
   pkg/NormqPCR/data/Colon.qPCRBatch.RData
   pkg/NormqPCR/man/normByHkg.Rd
Modified:
   pkg/NormqPCR/NAMESPACE
   pkg/NormqPCR/R/combineTechReps.R
   pkg/NormqPCR/R/dealWithNA.R
   pkg/NormqPCR/R/geomMean.R
   pkg/NormqPCR/inst/doc/NormqPCR.Rnw
   pkg/NormqPCR/man/stabMeasureRho.Rd
Log:
Quite a few updates. Want to clean up the data section so we only have 1 for each geNorm, Bladder, Colon and possibly BladderRepro - need to work out what this is about

Modified: pkg/NormqPCR/NAMESPACE
===================================================================
--- pkg/NormqPCR/NAMESPACE	2010-03-15 17:39:22 UTC (rev 98)
+++ pkg/NormqPCR/NAMESPACE	2010-03-17 19:05:12 UTC (rev 99)
@@ -1,2 +1,2 @@
 importClasses(qPCRSet)
-export(geomMean,stabMeasureM,stabMeasureRho,selectHKs,normByHkg,replaceNAs,deltaDeltaCt,deltaDeltaAvgCt,produceHkgsDF)
+export(geomMean,stabMeasureM,stabMeasureRho,selectHKs,deltaCt,replaceNAs,deltaDeltaCt,deltaDeltaAvgCt,produceHkgsDF,makeAllNAs,combineTechReps,replaceAboveCutOff, makeAllNAs, replaceNAs)

Modified: pkg/NormqPCR/R/combineTechReps.R
===================================================================
--- pkg/NormqPCR/R/combineTechReps.R	2010-03-15 17:39:22 UTC (rev 98)
+++ pkg/NormqPCR/R/combineTechReps.R	2010-03-17 19:05:12 UTC (rev 99)
@@ -8,9 +8,7 @@
     origDetectors <- row.names(expM)
     if (FALSE %in% grepl("_TechReps", origDetectors)) stop("These are not tech reps")
     newDetectors <- unique(gsub("_TechReps.\\d","", origDetectors))
-
     NewExpM <- matrix(nrow = length(newDetectors), ncol = dim(expM)[2], dimnames = list(newDetectors,colnames(expM)))
-
     for(detector in newDetectors){
       dValues <- as.numeric(apply(expM[grepl(detector, origDetectors),],2,geomMean,na.rm=TRUE))
       NewExpM[detector,] <- dValues

Modified: pkg/NormqPCR/R/dealWithNA.R
===================================================================
--- pkg/NormqPCR/R/dealWithNA.R	2010-03-15 17:39:22 UTC (rev 98)
+++ pkg/NormqPCR/R/dealWithNA.R	2010-03-17 19:05:12 UTC (rev 99)
@@ -26,21 +26,19 @@
 # makeAllNAs - for each detector, if you have > a given number of NAs, then all values are all replaced with NA
 # This means we can ignore any NAs in future calculations (since they can be dealt with using these functions
 setGeneric("makeAllNAs",
-  function(qPCRBatch, maxNACase, maxNAControl, contrastM, case, control)
+  function(qPCRBatch, contrastM, sampleMaxM)
   standardGeneric("makeAllNAs")
 )
 setMethod("makeAllNAs", signature = "qPCRBatch", definition =
-  function(qPCRBatch, maxNACase, maxNAControl, contrastM, case, control) {
-    case <- row.names(contrastM)[contrastM[,case] == 1]
-    control <- row.names(contrastM)[contrastM[,control] == 1]
+  function(qPCRBatch, contrastM, sampleMaxM) {
     expM <- exprs(qPCRBatch)
-    caseM <- expM[,case]
-    controlM <- expM[,control]
-
     for (detector in featureNames(qPCRBatch)) {
-      if(sum(is.na(expM[detector,case])) > maxNACase) caseM[detector,case] <- NA
-      if(sum(is.na(expM[detector,control])) > maxNAControl) controlM[detector,case] <- NA
+      for(phenotype in colnames(sampleMaxM)) {
+        pColumns <- row.names(contrastM)[contrastM[,phenotype] == 1]
+      if(sum(is.na(expM[detector,pColumns])) >= sampleMaxM[,phenotype]) expM[detector,pColumns] <- NA
+      }
     }
+    exprs(qPCRBatch) <- expM
     return(qPCRBatch)
   }
 )

Modified: pkg/NormqPCR/R/geomMean.R
===================================================================
--- pkg/NormqPCR/R/geomMean.R	2010-03-15 17:39:22 UTC (rev 98)
+++ pkg/NormqPCR/R/geomMean.R	2010-03-17 19:05:12 UTC (rev 99)
@@ -6,10 +6,13 @@
     warning("argument is not numeric or logical: returning NA")
     return(as.numeric(NA))
   }
+  if(! FALSE %in% (is.na(x))) {
+    warning("no non-NAs in 'x'"); return (NA)
+  }
   if(na.rm) x <- x[!is.na(x)]
   if(length(x) == 0)
     stop("x is a vector of length 0")
-  if(any(x < 0)) 
+  if(any(x < 0))
     stop("'x' contains negative value(s)")
 
   return(prod(x)^(1/length(x)))

Deleted: pkg/NormqPCR/data/Bladder.qPCRBatch.RData
===================================================================
(Binary files differ)

Added: pkg/NormqPCR/data/Bladder.qPCRBatch.RData
===================================================================
--- pkg/NormqPCR/data/Bladder.qPCRBatch.RData	                        (rev 0)
+++ pkg/NormqPCR/data/Bladder.qPCRBatch.RData	2010-03-17 19:05:12 UTC (rev 99)
@@ -0,0 +1,23 @@
+‹      íYTç^–‡°"ŠEÛDcªnvyã#@
+**Z•ì ÛÂîº;ÄGl&6žÚššˆkH)Dò”AY–·¨ (Eä©­šø±±±³÷ÎÀî‚%ÉIlzŽœ3ÎÜîïwïýþûÿ³Ïs„	x<ŸÇ˜ñøæÌ£ŸùÇŒ¹l˜ËÞ'†”H(¥pCo°IGFóÌÌÇ›(ِ*¹y>I“úéì‹»ÆJ–Ô&…RÅx²cÆv©šÆ;ÔDµ*!!á ‘ìSªHnûÊß_3ý–(¼ˆrÒ/çÁ=y»“zٍDÂm”ã{0š¯©"¡ã–Î âØZ?èçŸÅIÆƒÝ#;à~´pß–Nÿ,¢íÐWŒ™ÉDÞl{ð_þoó縦a¥`žâqVB0 yÄé¿Áûº×Á û’hjÜøþ‘´I€¨Ù§mÌÛ@T~î'u›ÀNêk–à›Äå•@/¯pÈ…-ÙÌyDíE;À­ÙâÂü9Ó*á}öTÄ{xøËwüS}}ý¢!匃øþxN;ä£Hñ6àLX·æ×$Fƒ¿$+ÏÕÕéCœÏð q~ær5à,”ÞÑ+Y€çÄÞÑ_^¦p–	0¾ü[¶€#ef9àÈêÁ¼w<œ ²ú`7èqù| À¤Û‘¨´vøξºß"*?­;3€«µÖƯþ ìÔ¬zêZ]‘ÎL­ŽÜk˜Ÿvç À[èåzµö©PïÞŸ•ƒ½ââ 7øÞ<šq WsòwÀæ^€¯§kæë}Pïšôj˜§ù:xr<ýv5ó C¹Þì#Ð8m7è×w/¿MÛâÀÞÙåÓ¢˜?¢îúRÈcÏÕ°wÛãyˆ¯¼ã¨dïUÞÈCm{èujiÌOÒ9˜¯ywÔùÎ>/Àº½s³/C~vÜ»Åû1
+‰!>Ýodȯw­uãø Wæeù®Ð!Ï»æ þªEh¯öêl¸·‹Í ×%Æßô«NÏ~ñh:c(û¼ü4Ÿ8;ÿöµ…ÅXw6¾ZA
+ÜóÿŒ|l9ŠøOx"_N„ñ`üæ|	Ø-Y¿óqyß‡|Î=S r…ò¯-úˆ/¥y¤}뢞3îIï`=µ«q½%9ýp¥¾ˆ} Æl*àú¸yŸnãã)Â5€ãpÊÉñÈsÍL´Ÿ¹ûNÒnì/lÙó"ÄÓ²­ôónãú¯|ã¹õ±
+ø\h…뱺×IU¸Ø-³ø9Ô…ãgWßRÀ_=y ¼pßÙöò„ˆ£›¾ï‹ï£ÿJ®×¶­h÷ÜËrx_=
+ûEn+ú=Ñ‹ë»õkì7~ü——®žånm†ù§°ŽGwwÂûÖÈk€K-LƒºT)âÇÏñ0¯j:ö¿3ÕX‡SGÐoiÊUX-³6ãúBÞÀõšËú[“úÙb¿ï>>ê]8+
+æ—•€£sGä¹Ìyu!ëpQð
+ŒŸîE^1x3æU?ÂuYˆþ‹–a}óG—šò G·ß†üäìÁ>Ùá4øŠûR™5®—RKœ_ÒŠumÌÿüµ[vn͝P÷âfäƒ:yÿÙyœ×j³î¹ÿ
+v‹hÌW—Ä[Ò†<®Ã<«·c+
+Ep|i¡c žR{|_<(\ûizÖK÷FÌËýùVž‹õ¾Œû›öåûgmònÀ­9‚ýCëŠ|çòye,»¾~
+rùRœ_…q¦­ÇüWÛc>ÒÎ`ýÓç`ÿoñ6ä7Óó[¤Dœim¼¦Ç㺩ܒ8k_c÷ç«5:ˆ7ßýœ¸xïvyC<
+ž‡7ϧì<L	ùh<Õ v®ô.<_ä€ÿºl샽¶o^_ú.ÈCÇÝÃ0^3F84y°ŸiÛÀOï	{ÈË©{ÈOí<\*ÑÎjå\ÀyÁò%°W·ó^Öƒ<Î¥1_ÝW« OAæ©ä}vßòÛ ø³?Á}¹uïßà½Ú÷‹ŒìkçWøÁx©òªl?ò(Íó›ÂÃ~V~÷ñ죫ñþ—¸¾ó'¢^ê*¬ÇeúÏÙ€|S'cß½7òP:×ùéÆàIuæ©"ëÈíGš/OÍÖ‹ØÇW½ýÐ	×cbÖ±¾
+×GŽùzr:žëz‚'®")ò¯¼yp\ˆý=;ðài×þÛÜBÿçðœ™'ÂþPŠç¿Ô
+/™Šç«¤B<§|÷¢2<G˜‹ûAúzÌχ;0®ƒ®Óßþ—0_Ç‚¿zbûDˆýä#öÙœyÈ›+TÈ'uXwnýý3
+ó˜_Žù¸ }d
+ËM æãúž‘7.¾“ŸyB<Ú‡/À½ôu<7›Ìö¿]¹€WMãúU›‚xê¯Ç ÞÒ›¸ÖnD^T¦÷⹤)ûKöë&>îÉàWks"oöÉ‚¬[×ýG`Góê1ˆ£œFüw¤À›¢ <]ðÇ<i.áù ²÷•n·)€›ãË)–•7w!
+ n&_ æi,s_2<ó‰Á›d¢bͨÈÈXŠùá9°zcX]ý{oßPî[Å;4ȍ,|ýÅœ¿ÀEÎ"‘‹ˆSô\êÌ)ú{Íç^„ùö›
+»Îœ`"‰¼Ý9¡üCûŸƒB9¯æË}|}Yà“Ø¡ab‘ØU(Å.b#ÑÝè­³ÈÝH‹n"#Ñd®‡‘e7cqÀ”U˜‹³Hè1 ¹¸	Ýû%7‘XèÖ/¹‹<æ¹{Zñ;JÎnB#iÀŠ§‹¡O/Éy at r5Òôp3’Œ¼{Š
+$/±¡M/W±AD^î€ìãËø;YMÉäð<ø#Ú^Ã|I¯ ”*©\Î(9°
+zb›³Ïf° L>®a&Cê1†Œg-©L”G(ÈÈß’ë)–GýÃ>Ry©¢† nÉ-Cý±Þ2™œ&iJ¢ÈOɨ1u䛤r1E“øu ? ½!>«â@*#¤´’Tnž"‹‹ ”R™þð`ó˜ùCk#›øCFP1ó)U¤Rª ™M3­”o‚æ|Y©ÈXEÅÅ寔Ç)p®©²0ê	qYÄg+4‰}Ïg«¥ÿ)ÄRïTŸ]}A8Ëú¼0—-;Oß‚F³Þíõ™åa‹rd®ç˜ëyæÇ\/0CÞæšÈú3ìüPò)<‰Ð'‹PçY®O÷ÙˆQÃc§ú¬áþî÷Xº6ÌI Pß?L›ÃHäÀ¶oè‡Fᐯ<&.–k¤zwüa;¡^S`
+̸Çn–QIÇ))ã-Âúñð;Á L&Í$C6ÙÿÚàm›tsÞwkÕý«Š÷]jhÇy5õö­¬ùý¿<÷±imÚ½lYâR׎{Jܵ£6)˜­;–’Ñß’¾¼—¾–‹z/^0RrÊP™gúAÁ°v•‘rMFÒèYÒR:f8wÖd„Š9
+kÌ<N3ŒŠ".b1%Y(1=¯
+­û2}m½9B)•H·4ÖaH-[™\ëË$B)y’Î(…’R(å‘”J…'»¡”,åt4¥4~9ˆ\I¿?$:aψ…IË#å1ÏÚïß~Ÿ¦~‚‡©'î/ÿ«“QÿÚÓ¯9níéA	xÆëQ?fżF͍ÉùC­QsVÅ,x°.l1TEÌäÚfà¿Ó‡ömL‘½Ïàç„ÿ |y ¯  
\ No newline at end of file

Deleted: pkg/NormqPCR/data/Colon.qPCRBatch.RData
===================================================================
(Binary files differ)

Added: pkg/NormqPCR/data/Colon.qPCRBatch.RData
===================================================================
--- pkg/NormqPCR/data/Colon.qPCRBatch.RData	                        (rev 0)
+++ pkg/NormqPCR/data/Colon.qPCRBatch.RData	2010-03-17 19:05:12 UTC (rev 99)
@@ -0,0 +1,27 @@
+‹      íZt“ÕmC
+ŠYPЛ4iS÷µAiKëª"˜¶Û$&©Bå0œ2yµÐé#IÛ¼IÛ”>xIœG'>`2˜Èæk0¦°ûÝßMš¤uõ17v=çr¿ûÝÿý?ÿÿýç;dOÉ“ÄåÅ	‚ADÜ AD$yŒŠ ÿ"#–Œ…¶X«=9[‘¡4	E^F«4”K¦(Jþ0Ûø<*”H¨Z¬ÓˆœadÄp«}Õ½zî$îÕ»ðܪ]q“u5‡¹ß®;‘ìp¯	oô>øÉ
+®|”€ÿãÖ|úŠëkÇM~’[e “n;·yæ5çÀgÝprêF/÷â!ÐÙ.´›Ú4Š³ÿq]yàL&ðÙ`_OvürŽ“#è9S%/~.gŸ¡$Çžá¬[_¤zY³1;VjF•›Æ96ž¢tuÑõtž»uåÿð™”ßCvr¼ì÷èÐgÑzB5ñï\þè›5„¼}ð÷x2ýãæÏÃù¢Ð+Oû翺ÇäÐÛ;»€ÚÕ–zzœH ÛÅu?#¤tŽøL*çiØåù þtøK*·5
+vz>¼ƒpÞ9ÊsA×qØÆ;k;põ«=zØcDT®'~mMü†¸%Ž³)¥úu.}šž÷êá¿Ž‡ªèìÔB_Wv'µ¯mÒQ*Ï:aµ§Ñ¹æ#ðWEì7½»jlíä·³¹ú7‘¿Íܶsð«©ñµ¬A<–@ßíÁ¾VÑ2*×Z~ê]û6ìßt
+ñ¨‰E¼j}[©œ%âXÝ}^;¹f™ŽúÅVvåc9ºÚ‘àïÍ}žêãS/žÙ×R=M3¡·³þ²½8Xï ÞÄÐßœšAÏÛ†¿C×^	âèþÃ*:7w1».î£úÖ;ŽÐøVæ7•e°ß!B<ªëà§
+_`¿ê üeo=Uù˜›G'5ÿ„šo@>Yî)£v:fäP}l¥2Ê·¹zzîÀºõøªWË=å”Ï®¡l?á<ÈµI[ûÍ—Žâê§Ê|à¥ê/Nšëä«iܪeöÞ‰|®bx.ù`º?o=Šúan€}›Ï /uäT~õ#M¿‚ók΀ߊ¼颗Ò=}þجÜ²iˆÏKzÌËê¡×+¹ _Ñü¬ü^™<TeÂs<âTÑ ¼=sç]ã ú6,z‚â¢ñjøÙ}þ³›žsô›ôœ§$šòsÔ#[šo§ûž¬•ô½[½ÚŽ/¥8ëZùgúÞ§€]­ðûôcÔßÞÀ£+u£ëÐužnìۀîEƒ(}÷$ØÙæŸý/"|'n zï_Üì=ý1õß›™¹4No\…ý½÷—{3ê¨^Ý#7û² ÷–6à´ö
+ø£"ü·¼¿®=ÍòånØ¿>ñ«¼þ]W‹uõò“TÊ}à[±ö®~æ ·MÖNí¯ÿñö†þ®¿7¯¯°"ï–‚O§õÄôòÕö:pmû øm_:ë6ø¯1ñ¶NË7¿Õg_O:‹÷}з#Å@q³û«Ï‡pÏtnEœÛRÞ§|}šTnó§ÐÓ;
+þÚ£GžÚ3Qw€ƒ]+–Súî{tWÏÊoßQÈír#:îvS½v¿3šÎû?B½v6 ~5m®í«Ócð_çNÌö•°ËíA=o¨€¼ø§Y9Îgq¿Xf¡^yo?[9è*f ÕïÀæ]_c…ßíRäyûø«ê׈g]3ü_ûôlˆÅýR7çw¼½š>…vÿêÑ8zyËgQy»Ù}Ù’l¡ç:;EãÔþÈë
+u_B~·=€üiº{­"Ô™Î1´°pÞq¨«Ï-¦ú™ƒç]È+Wâ»+
+ùØz;ò¿[~näø²?ÛyVw³áç*vï݉8l_
+<T?¿:†U«áÖá¬/x÷-ŠÇö7‹þîÚ«¥óvä6u³ýßCgê€/
+øl[†}ëDà¶Ù‚úë†ú¾á-øËåþ݁;gë¿V >íOâžóÌ@½ó
+×9ðÞú1ðèKE]ì:ÉÑõîlø£kú’½çqïID<;£A·¯¸Þ݃÷îÔ£cž¾Ü–¯‘GÕ_¢n¸ÔЯQ‰8×½L	W›ˆxÔ«Q—,*Ö?U­Q8oZ¿U½Ëp\ˆúUó<âµvêNå^Öÿ¨q¯lšˆ÷dzúµç+>€ÿËO±<‰D_³1~·% îž™¸ìà|e"âcgu¤éà¾vîë†9_y	üG£ÿ²tC®W¹æ±àcš‡øÔ@nÍIøc“ôUnعm<ö·Ü
+=¶yàÍ›€›š­ÀCÕEà¤a!ìߦÃÚÚƒºà9¿;ÔÀ{¥ý³u
+ê«íK–ÿËXßpz4çìÛñø:AÏÛ>Åygø7A_U'‡ž
+·±þs5òmûõ°«j*ü_óüXþ*«‹£“zVÿš‚Ÿy?ôõ°zí[ƒür3ÿ´ì¼êí¼çZÞdý3‡ºì~a
+Õ¿Û=w¨ÑGw”¡ŸðMºý÷Ð
+tvŒ½Åy–	Èû-kY݃¹v7êM}ìªÝ	}êMˆgc7üÙ8ñn®Ç9‹yãûõÅrõö‰Å«~·ŸB½÷¼‡ürÉQ=GןÏ­ðwÌBü;Ìàëò o̓!Ç~«c9¨Ë]R𱩠·'¾ˆâ¤Õ?Y^®;o£þêüp'}oÏÅïŸÆÈ_üèüôm¾„ø¹zÆR»ÜGP×<;ïºÀåKÖ÷­‡?í,Þ/£þ¸Šð{Ê7r¬GÓS¨æÄÕ• þ¶É¨×Rvϧ#Ž^V÷|gqÞ•ÈpP;šV¡yïÁ}Òh`x@/ËÏÁ¯5Šá«q2ÿú»ÅˆKã9Øgvƒ_ÓràÚq;poÿ
+ùÐtz¶xá/Ë/ûsèW›oƒÞNê‘yâWkCÞÕŽ^\bÄ×# í=è¯|9èëJŠ»°/‘…ê2
+¥ß10O#‰!$e‰Ê@žG2ºáŒ–ߏJWädøŸ÷gŠÏ™9
+?û3$%%'ù÷¦¦Ïžâž™®H÷ëÈž=Gœ´øQsr§8çÌÎñ?sr3ÒSüÖäfdô>*˜¢Ù«h…H!N’ç-%bYÈR*	^JCw¥iÝ…8U*’ÈSkirš(%9-°–IRD©©=ÖËŽ¬e²€*1ÓùídièZ– 'ëä´Àr0YJeâ MY²$˜V–*^¦¦„,åII!KiRãÜ^­„Ó¥²´™þÅ‘"% ’_ÈÖž#Ê•˜óˆ)齱ĿˆÊ÷Æ3Oœ,zNë}–ÊzŸeAô©i½LåI~¦1yR‰L”’p}žL"¥Š®ÏK‘¦ŠäF±y©b¹(­×Qy©’^f©idSî?™—ÆCöbèý†§+Ri´ô^ß|#Dóç+
+†‡TzƒZ«™?Ÿd|E²g~ÂéI’pÃ^Æ0N†0âh²à	åBÃ|àu†Z›¯4¨úQ\èOê`ú«Ò5­QiTòݯ'$ýò”RŸ¥2*é—Ë€A<£F2R©ÏWõJý’›4¥%ù*½Z³ßºDþÀmÈ¥0ÙË•ùªâ)*C^­3Ã=­×>-
+VÚ/k°AY¢+Vù횪זêp66\F¯²hÁ·ØdPP9¤û,ZügZ!/”÷.?gÞ/dijsÃÈH`ÒGðž |òŸeG“q5א1†Áud\OÆ
+düŒŒÉH$ã&2Æ’q3ãÈOÆ2n!ãV¦_p•<S«/Q_«è)¥O¨7¥_–ËŒËr©¸l–!9:pª
+õ“^¹n¯\·?êºý…;–ô¨™üí~5^g²[ƒ5¯ÚâÒÿ5Ê‹‹ðä)ã½aû^•TJc©^Ú Ä\¸è£SØÕ?€&ý^±ÿöz¿v—¾ßE¨ ‚ïÃa~©áÒ¾—¹ÿ¿H˜Ù	á•5ž%ªÃØ»ÿV‡©ëH£V¢Ò¿#\?-\…YÓÓ³îëGÓ(
+0L,ÿiKP: ItVcT ÕÆâÄÅ(ó
+¤ßYd©¾x ’X]i~–ªpzaxwÞG”2ÿ/óðíaEKòõêBu™Òˆ8ôK¯!-›‚8B¯-þ6š¡:½J§×¨ôñý	µÆ"•>t³*ü!ý!øŒSè´â׈^[ˆ’Fm¶øJ¹ýéËí•FïJ£÷£¿«ô{þ¯º¶@à냿NðJÅ	Bkÿn° o=‰M¤ÿT=‰d$ƒ²ûÒRW«æ¨Œ½çúˆŽíýOhýËŽÉV)y"AЇ®ÅÏ ã&  
\ No newline at end of file

Modified: pkg/NormqPCR/inst/doc/NormqPCR.Rnw
===================================================================
--- pkg/NormqPCR/inst/doc/NormqPCR.Rnw	2010-03-15 17:39:22 UTC (rev 98)
+++ pkg/NormqPCR/inst/doc/NormqPCR.Rnw	2010-03-17 19:05:12 UTC (rev 99)
@@ -1,276 +1,368 @@
-%\VignetteIndexEntry{NormqPCR}
-%\VignetteDepends{stats,RColorBrewer,Biobase,methods,ReadqPCR}
-%\VignetteKeywords{real-time, quantitative, PCR, housekeeper, reference gene, geNorm, NormFinder}
-%\VignettePackage{NormqPCR}
-%
-\documentclass[11pt]{article}
-\usepackage{geometry}\usepackage{color}
-\definecolor{darkblue}{rgb}{0.0,0.0,0.75}
-\usepackage[%
-baseurl={http://qpcr.r-forge.r-project.org/},%
-pdftitle={NormqPCR: Functions for normalisation of RT-qPCR data},%
-pdfauthor={Matthias Kohl and James Perkins},%
-pdfsubject={NormqPCR},%
-pdfkeywords={real-time, quantitative, PCR, housekeeper, reference gene, geNorm, NormFinder},%
-pagebackref,bookmarks,colorlinks,linkcolor=darkblue,citecolor=darkblue,%
-pagecolor=darkblue,raiselinks,plainpages,pdftex]{hyperref}
-%
-\markboth{\sl Package ``{\tt NormqPCR}''}{\sl Package ``{\tt NormqPCR}''}
-%
-% -------------------------------------------------------------------------------
-\newcommand{\code}[1]{{\tt #1}}
-\newcommand{\pkg}[1]{{\tt "#1"}}
-\newcommand{\myinfig}[2]{%
-%  \begin{figure}[htbp]
-    \begin{center}
-      \includegraphics[width = #1\textwidth]{#2}
-%      \caption{\label{#1}#3}
-    \end{center}
-%  \end{figure}
-}
-% -------------------------------------------------------------------------------
-%
-% -------------------------------------------------------------------------------
-\begin{document}
-\SweaveOpts{keep.source = TRUE, eval = TRUE, include = FALSE}
-%-------------------------------------------------------------------------------
-\title{NormqPCR: Functions for normalisation of RT-qPCR data}
-%-------------------------------------------------------------------------------
-\author{Matthias Kohl\\ 
-University of Bayreuth (Germany)\medskip\\
-}
-\maketitle
-\tableofcontents
-%-------------------------------------------------------------------------------
-\section{Introduction}
-%-------------------------------------------------------------------------------
-The package \pkg{NormqPCR} aims at providing methods for the normalization of 
-real-time quantitative RT-PCR data. In this short vignette we describe and 
-demonstrate the available functions.
-%-------------------------------------------------------------------------------
-\section{Selection of most stable reference/housekeeping genes} 
-%-------------------------------------------------------------------------------
-%-------------------------------------------------------------------------------
-\subsection{geNorm} 
-%-------------------------------------------------------------------------------
-We describe the selection of the best (most stable) reference/housekeeping genes 
-using the method of Vandesompele et al (2002)~\cite{geNorm} (in the sequel: Vand02)
-which is called {\it geNorm}. We first load the package and the data
-<<NormqPCR>>=
-options(width = 68)
-library(NormqPCR)
-path <- system.file("exData", package = "NormqPCR")
-geNorm.example <- paste(path, "/qPCR.geNorm.txt", sep="")
-geNorm.qPCRBatch <- read.qPCR(geNorm.example)
-str(exprs(geNorm.qPCRBatch))
-@
-We start by ranking the selected reference/housekeeping genes. The geNorm
-algorithm implemented in function \code{selectHKs} proceeds stepwise; confer 
-Section ``Materials and methods'' in Vand02. That is, the gene stability 
-measure~M of all candidate genes is computed and the gene with the highest 
-M~value is excluded. Then, the gene stability measure~M for the remaining gene 
-is calculated and so on. This procedure is repeated until two respectively, 
-\code{minNrHK} genes remain.
-<<geNorm>>=
-
-geNorm <- t(exprs(geNorm.qPCRBatch))
-
-tissue <- as.factor(c(rep("BM", 9), rep("POOL", 9), rep("FIB", 20), 
-                      rep("LEU", 13), rep("NB", 34)))
-res.BM <- selectHKs(geNorm[tissue == "BM",], method = "geNorm", 
-                    Symbols = colnames(geNorm), minNrHK = 2, log = FALSE)
-res.POOL <- selectHKs(geNorm[tissue == "POOL",], method = "geNorm", 
-                      Symbols = colnames(geNorm), minNrHK = 2, 
-                      trace = FALSE, log = FALSE)
-res.FIB <- selectHKs(geNorm[tissue == "FIB",], method = "geNorm", 
-                     Symbols = colnames(geNorm), minNrHK = 2, 
-                     trace = FALSE, log = FALSE)
-res.LEU <- selectHKs(geNorm[tissue == "LEU",], method = "geNorm", 
-                     Symbols = colnames(geNorm), minNrHK = 2, 
-                     trace = FALSE, log = FALSE)
-res.NB <- selectHKs(geNorm[tissue == "NB",], method = "geNorm", 
-                    Symbols = colnames(geNorm), minNrHK = 2, 
-                    trace = FALSE, log = FALSE)
-@
-We obtain the following ranking of genes (cf. Table~3 in Vand02)
-<<table3, eval = TRUE>>=
-ranks <- data.frame(c(1, 1:9), res.BM$ranking, res.POOL$ranking, 
-                    res.FIB$ranking, res.LEU$ranking, 
-                    res.NB$ranking)
-names(ranks) <- c("rank", "BM", "POOL", "FIB", "LEU", "NB")
-ranks
-@
-{\bf Remark 1:}\\
-Since the computation is based on gene ratios, the two most stable
-control genes in each cell type cannot be ranked.
-
-We plot the average expression stability M for each cell type 
-(cf. Figure~2 in Vand02).
-<<fig2, fig = TRUE>>=
-library(RColorBrewer)
-mypalette <- brewer.pal(5, "Set1")
-matplot(cbind(res.BM$meanM, res.POOL$meanM, res.FIB$meanM, 
-              res.LEU$meanM, res.NB$meanM), type = "b", 
-        ylab = "Average expression stability M", 
-        xlab = "Number of remaining control genes", 
-        axes = FALSE, pch = 19, col = mypalette, 
-        ylim = c(0.2, 1.22), lty = 1, lwd = 2, 
-        main = "Figure 2 in Vandesompele et al. (2002)")
-axis(1, at = 1:9, labels = as.character(10:2))
-axis(2, at = seq(0.2, 1.2, by = 0.2), labels = seq(0.2, 1.2, by = 0.2))
-box()
-abline(h = seq(0.2, 1.2, by = 0.2), lty = 2, lwd = 1, col = "grey")
-legend("topright", legend = c("BM", "POOL", "FIB", "LEU", "NB"), 
-       fill = mypalette)
-@
-\myinfig{1}{NormqPCR-fig2.pdf}
-\par
-Second, we plot the pairwise variation for each cell type (cf. Figure~3~(a) in Vand02)
-<<fig3a, fig = TRUE>>=
-mypalette <- brewer.pal(8, "YlGnBu")
-barplot(cbind(res.POOL$variation, res.LEU$variation, res.NB$variation, 
-              res.FIB$variation, res.BM$variation), beside = TRUE, 
-        col = mypalette, space = c(0, 2), 
-        names.arg = c("BM", "POOL", "FIB", "LEU", "NB"),
-        ylab = "Pairwise variation V",
-        main = "Figure 3(a) in Vandesompele et al. (2002)")
-legend("topright", legend = c("V9/10", "V8/9", "V7/8", "V6/7", 
-                              "V5/6", "V4/5", "V3/4", "V2/3"), 
-       fill = mypalette, ncol = 2)
-abline(h = seq(0.05, 0.25, by = 0.05), lty = 2, col = "grey")
-abline(h = 0.15, lty = 1, col = "black")
-@
-\myinfig{1}{NormqPCR-fig3a.pdf}
-\par\noindent
-{\bf Remark 2:}\\
-Vand02 recommend a cut-off value of 0.15 for the pairwise variation. Below this
-bound the inclusion of an additional housekeeping gene is not required. 
-%-------------------------------------------------------------------------------
-\subsection{NormFinder} 
-%-------------------------------------------------------------------------------
-The second method for selection reference/housekeeping genes implemented in 
-package is the method derived by \cite{NormFinder} (in the sequel: And04) called 
-{\it NormFinder}.\\
-The ranking contained in Table~3 of And04 can be obtained via
-<<NormFinder>>=
-Colon.example <- paste(path, "/qPCR.colon.txt", sep="")
-Colon.qPCRBatch <- read.qPCR(Colon.example)
-str(exprs(Colon.qPCRBatch))
-Colon.qPCRBatch[["Group"]] <- c(rep("Normal",10),rep("Dukes A",10),rep("Dukes B",10),rep("Dukes C",10))
-pData(Colon.qPCRBatch)
-res.Colon <- stabMeasureRho(Colon.qPCRBatch, 
-                            log = FALSE)
-sort(res.Colon) # cf. Table 3 in Andersen et al (2004)
-
-Bladder.example <- paste(path, "/qPCR.bladder.txt", sep="")
-Bladder.qPCRBatch <- read.qPCR(Bladder.example)
-str(exprs(Bladder.qPCRBatch))
-Bladder.qPCRBatch[["Group"]] <- c(rep("Ta",10),rep("T1",8),rep("T2-4",10))
-pData(Bladder.qPCRBatch)
-
-res.Bladder <- stabMeasureRho(Bladder.qPCRBatch, 
-                              log = FALSE)
-sort(res.Bladder)
-@
-Of course, we can also reproduce the geNorm ranking also included in Table~3
-of And04.
-<<NormFinder1>>=
-selectHKs(Colon.qPCRBatch, log = FALSE, trace = FALSE, 
-          Symbols = featureNames(Colon.qPCRBatch))$ranking
-selectHKs(Bladder.qPCRBatch, log = FALSE, trace = FALSE, 
-          Symbols = featureNames(Bladder.qPCRBatch))$ranking
-@
-As we are often interested in more than one reference/housekeeping gene we also
-implemented a step-wise procedure of the NormFinder algorithm explained in Section
-``Average control gene'' in the supplementary information of And04. This procedure
-is available via function \code{selectHKs}.
-<<NormFinder2>>=
-selectHKs(Colon.qPCRBatch, 
-          log = FALSE, trace = TRUE, 
-          Symbols = featureNames(Colon.qPCRBatch), minNrHKs = 12,
-          method = "NormFinder")$ranking
-selectHKs(Bladder.qPCRBatch, 
-          log = FALSE, trace = FALSE, 
-          Symbols = featureNames(Bladder.qPCRBatch), minNrHKs = 13,
-          method = "NormFinder")$ranking
-@
-%-------------------------------------------------------------------------------
-\section{Normalization by means of reference/housekeeping genes}
-%-------------------------------------------------------------------------------
-
-\subsection{$2^{\delta \delta Ct}$ method using a single housekeeper}
-
-It is possible to use the delta delta Ct method for calculating the relative gene expression. 
-Both the same well and the seperate well methods as detailed in \cite{ddCt} can be used for this purpose.
-They have been named \code{deltaDeltaCt} and \code{deltaDeltaAvgCt} respectively, with \code{deltaDeltaAvgCt} so named since it calculates the average standard deviation between case and control as s = $\sqrt{s_{1}^{2} + s_{2}^{2}}$.
-This approach is not recommended when the housekeeper and genes to be compared are from the same sample, as is the case when using the taqman cards, but is included for compleness and for situations where readings for the housekeeper might be taken from a seperate biological replicate for example in a {\it post hoc} manner due to the originally designated housekeeping genes not performing well, or for when NormqPCR is used for amplifications from seperate wells.
-
-for the example taqman dataset from \pkg{ReadqPCR} we must first read in the data:
-<<taqman 1>>=
-path <- system.file("exData", package = "ReadqPCR")
-taqman.example <- paste(path, "/example.txt", sep="")
-qPCRBatch.taqman <- read.taqman(taqman.example)
-@
-
-\code{deltaDeltaCt} and \code{deltaDeltaAvgCt} also require a contrast matrix. This is to contain columns which will be used to specify the samples representing \code{case} and \code{control} which are to be compared, in a similar way to the \pkg{limma} package. these columns should contain 1s or 0s which refer to the samples in either category:
-
-<< contrast >>=
-contM <- cbind(c(0,0,0,0,1,1,1,1),c(1,1,1,1,0,0,0,0))
-colnames(contM) <- c("interestingPhenotype","wildTypePhenotype")
-rownames(contM) <- sampleNames(qPCRBatch.taqman)
-contM
-@
-
-We can now normalise each sample by a given housekeeping gene and then look at the ratio of expression between the case and control samples. Results show the difference between the mean value for case and control following subtraction of the housekeeping genes (first column) followed by the range of values that correspond to 1 s.d. either side of the mean value, as detailed in \cite{ddCt}
-
-<< ddCt >>=
-hkg <- "Actb-Rn00667869_m1"
-ddCt.taqman <- deltaDeltaCt(qPCRBatch.taqman,1,1,hkg, contM, "interestingPhenotype","wildTypePhenotype")
-head(ddCt.taqman)
-@
-
-We can also average the taqman data using the seperate samples/wells method \code{deltaDeltaAvgCt}.
-Note how although the values are the same the ranges (+/- 1 s.d.) are generally a little higher.
-This is because the averages of case or control are calculated, and the average values for the respective housekeepers are calculated independently and then subtracted. Therefore the pairing of housekeeper with the detector value within the same sample is lost.
-
-<< ddCt Avg >>=
-hkg <- "Actb-Rn00667869_m1"
-ddCtAvg.taqman <- deltaDeltaAvgCt(qPCRBatch.taqman,1,1,hkg, contM, "interestingPhenotype","wildTypePhenotype")
-head(ddCtAvg.taqman)
-@
-
-\subsection{$2^{\delta \delta Ct}$ method) using geometric mean of a number of housekeeping genes}
-
-When the user has identified a number of housekeeping genes, for example by using the NormFinder/geNorm algorithms described above, they can use the geometric mean of these values as a pseudo-housekeeper from which to subtract the other values. We illustrate this using the data from the geNorm dataset above.
-
-
-%-------------------------------------------------------------------------------
-\begin{thebibliography}{1}
-
-\bibitem{NormFinder}
-Claus Lindbjerg Andersen, Jens Ledet Jensen and Torben Falck Orntoft (2004).
-\newblock Normalization of Real-Time Quantitative Reverse Transcription-PCR Data: 
-A Model-Based Variance Estimation Approach to Identify Genes Suited for
-Normalization, Applied to Bladder and Colon Cancer Data Sets
-\newblock CANCER RESEARCH 64, 5245–5250, August 1, 2004
-\newblock \url{http://cancerres.aacrjournals.org/cgi/content/full/64/15/5245}
-
-\bibitem{ddCt}
-Kenneth Livak, Thomase Schmittgen (2001).
-\newblock Analysis of Relative Gene Expression Data Using Real-Time Quantitative PCR and the $2^{\delta \delta Ct}$ Method.
-\newblock Methods 25, 402-408, 2001
-\newblock \url{http://www.ncbi.nlm.nih.gov/pubmed/11846609}
-
-\bibitem{geNorm}
-Jo Vandesompele, Katleen De Preter, Filip Pattyn, Bruce Poppe, Nadine Van Roy, 
-Anne De Paepe and Frank Speleman (2002).
-\newblock Accurate normalization of real-time quantitative RT-PCR data by geometric
-averiging of multiple internal control genes.
-\newblock Genome Biology 2002, 3(7):research0034.1-0034.11
-\newblock \url{http://genomebiology.com/2002/3/7/research/0034/}
-
-\end{thebibliography}
-%-------------------------------------------------------------------------------
-\end{document}
-
-
+%\VignetteIndexEntry{NormqPCR}
+%\VignetteDepends{stats,RColorBrewer,Biobase,methods,ReadqPCR}
+%\VignetteKeywords{real-time, quantitative, PCR, housekeeper, reference gene, geNorm, NormFinder}
+%\VignettePackage{NormqPCR}
+%
+\documentclass[11pt]{article}
+\usepackage{geometry}\usepackage{color}
+\definecolor{darkblue}{rgb}{0.0,0.0,0.75}
+\usepackage[%
+baseurl={http://qpcr.r-forge.r-project.org/},%
+pdftitle={NormqPCR: Functions for normalisation of RT-qPCR data},%
+pdfauthor={Matthias Kohl and James Perkins},%
+pdfsubject={NormqPCR},%
+pdfkeywords={real-time, quantitative, PCR, housekeeper, reference gene, geNorm, NormFinder},%
+pagebackref,bookmarks,colorlinks,linkcolor=darkblue,citecolor=darkblue,%
+pagecolor=darkblue,raiselinks,plainpages,pdftex]{hyperref}
+%
+\markboth{\sl Package ``{\tt NormqPCR}''}{\sl Package ``{\tt NormqPCR}''}
+%
+% -------------------------------------------------------------------------------
+\newcommand{\code}[1]{{\tt #1}}
+\newcommand{\pkg}[1]{{\tt "#1"}}
+\newcommand{\myinfig}[2]{%
+%  \begin{figure}[htbp]
+    \begin{center}
+      \includegraphics[width = #1\textwidth]{#2}
+%      \caption{\label{#1}#3}
+    \end{center}
+%  \end{figure}
+}
+% -------------------------------------------------------------------------------
+%
+% -------------------------------------------------------------------------------
+\begin{document}
+\SweaveOpts{keep.source = TRUE, eval = TRUE, include = FALSE}
+%-------------------------------------------------------------------------------
+\title{NormqPCR: Functions for normalisation of RT-qPCR data}
+%-------------------------------------------------------------------------------
+\author{Matthias Kohl\\ 
+University of Bayreuth (Germany)\medskip\\
+}
+\maketitle
+\tableofcontents
+%-------------------------------------------------------------------------------
+\section{Introduction}
+%-------------------------------------------------------------------------------
+The package \pkg{NormqPCR} provides methods for the normalization of 
+real-time quantitative RT-PCR data. In this vignette we describe and 
+demonstrate the available functions. Firstly we describe how the user can deal with undertermined values, and choose their own threshold for this. Then we show how the user may combine technical replicates, and deal with NA values. The rest of the vignette is split into two distinct sections, the first giving details of different methods to select the best houskeeping gene/genes for normalisation, and the second showing how to use the selected housekeeping genes to produce $2^{-\Delta Ct}$ normalised estimators and $2^{-\Delta \Delta Ct}$ estimators of differential expression.
+%-------------------------------------------------------------------------------
+\section{Combining technical replicates together} 
+%-------------------------------------------------------------------------------
+When a raw data file is read in using read.qPCR contains technical replicates, they are dealt with by concatenating the suffix \_TechRep.n to the detector name, where
+n in {1, 2...N } is the number of the replication in the total number of replicates, N, based
+on order of appearence in the qPCR data file.
+
+So if we read in a file with technical replicates, we can see that the detector/feature names are thus suffixed:
+
+<<read.qPCR.tech.reps>>=
+library(ReadqPCR) # load the ReadqPCR library
+library(NormqPCR)
+path <- system.file("exData", package = "ReadqPCR")
+qPCR.example.techReps <- paste(path,"/qPCR.techReps.txt", sep = "")
+qPCRBatch.qPCR.techReps <- read.qPCR(qPCR.example.techReps)
+rownames(exprs(qPCRBatch.qPCR.techReps))[1:8]
+@
+
+It is likely that before continuing with the analysis, the user would wish to average the technical replicates by finding their geometric mean. This can be achieved using the combineTechReps function, which will produce a new qPCRBatch object, with all tech reps reduced to one reading:
+
+<<combine read.qPCR.tech.reps>>=
+combinedTechReps <- combineTechReps(qPCRBatch.qPCR.techReps)
+combinedTechReps
+@
+
+%-------------------------------------------------------------------------------
+\section{Dealing with undetermined values} 
+%-------------------------------------------------------------------------------
+
+When an RT-qPCR experiment does not produce a reading after a certain number of cycles (cycle threshold), the reading is given as undetermined. These are represented in qPCRBatch objects as "NA". Different users may have different ideas about how many cycles they wish to allow before declaring a detector as not present in the sample. There are two methods for the user to decide what to do with numbers above a given cycle threshold:
+
+First the user might decide that anything above 38 cycles means there is nothing present in their sample, instead of the standard 40 used by the taqman software. They can replace the value of all readings above 38 as NA using the following:
+
+
+Firstly read in the taqman example file from \pkg{ReadqPCR} which has 96 detectors, with 4 replicates for mia (case) and 4 non-mia (control):
+<<taqman read>>=
+path <- system.file("exData", package = "ReadqPCR")
+taqman.example <- paste(path, "/example.txt", sep="")
+qPCRBatch.taqman <- read.taqman(taqman.example)
+@
+
+We can see that for the detector: Ccl20.Rn00570287\_m1 have these readings for the different samples:
+<<taqman detector example>>=
+exprs(qPCRBatch.taqman)["Ccl20.Rn00570287_m1",]
+@
+
+
+Now use the \code{replaceAboveCutOff} method in order to replace anything above 35 with NA:
+
+<<replace above cutoff>>=
+qPCRBatch.taqman.replaced <- replaceAboveCutOff(qPCRBatch.taqman, newVal = NA, cutOff = 35)
+exprs(qPCRBatch.taqman.replaced)["Ccl20.Rn00570287_m1",]
+@
+
+It may also be the case that the user wants to get rid of all NA values, and replace them with an arbitrary number. This can be done using the \code{replaceNAs} method. So if the user wanted to replace all NAs with  40, it can be done as follows:
+
+<<replace NAs with 40>>=
+qPCRBatch.taqman.replaced <- replaceNAs(qPCRBatch.taqman, newNA = 40)
+exprs(qPCRBatch.taqman.replaced)["Ccl20.Rn00570287_m1",]
+@
+In addition, the situation sometimes arises where some readings for a given detector are above a given cycle threshold, but some others are not. The user may decide for example that if a given number of readings are NAs, then all of the readings for this detector should be NAs. This is important because otherwise an unusual reading for one detector might lead to an inaccurate estimate for the expression of a given gene. 
+
+This process will necessarily be separate for the different sample types, since you might expect a given gene to show expression in one sample type compared to another. Therefore it is necessary to designate the replicates per sample type using a contrast matrix. It is also necessary to make a sampleMaxMatrix which gives a maximum number of NAs allowed for each sample type.
+
+So in the example file above we two sample types, with 4 biological replicates for each. the contrastMatrix and sampleMaxMatrix might be contructed like this:
+
+<<construct contrast matrix>>=
+sampleNames(qPCRBatch.taqman)
+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) # the position of the 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
+sMaxM <- t(as.matrix(c(3,3))) # now make the contrast matrix
+colnames(sMaxM) <- c("case","control") # make sure these line up with samplenames
+sMaxM
+@
+
+More details on the contrast matrix can be found in the limma manual.
+
+For example, if the user decides that if at least 3 out of 4 readings are NAs for a given detector, then all readings should be NA, they will can do the following, using the \code{makeAllNAs} method:
+
+<<replace 3 or more NAs with all NAs>>=
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/qpcr -r 99


More information about the Qpcr-commits mailing list