[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ä©ø±±±³÷ÎÀî%ÉIlz3ÎÜîïwïýþûÿ³Ïs x<ÇñøæÌ£ùǹlËÞ'H(¥pCo°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Ükvç À[èå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ȯwuãø Wæeù®Ð!Ï»æ þªEh¯öêl¸·Í ×%Æßô«NÏ~ñh:c(û¼ü48;ÿöµ
ÅXw6¾ZA
+Üóÿ|l9øOx"_Nñ`üæ| Ø-Y¿óqyß|Î=S r
ò¯-ú/¥y¤}ë¢3îIï`=µ«q½%9ýp¥¾} Æl*àú¸ynãã)Â5ãpÊÉñÈsÍL´¹ûNÒnì/lÙó"ÄÓ²ôónãú¯|ã¹õ±
+ø\h
뱺×IU¸Ø-³ø9Ô
ãgWßRÀ_=y ¼pßÙöò£¾ïï£ÿJ®×¶h÷ÜËrx_=
+ûEn+ú=Ñë»õkì7~ü®ånmù§°GwwÂûÖÈkK-LºT)âÇÏñ0¯j:ö¿3ÕXSGÐoiÊUX-³6ãúBÞÀõËú[úÙb¿ï>>ê]8+
+æ£sGä¹Ìyu!ëpQð
+îE^1x3æU?ÂuYþa}óGò G·ßüäìÁ>Ùá4øûR5®RK_ÒumÌÿüµ[vnÍP÷âfä:yÿÙy×j³î¹ÿ
+vhÌWÄ[Ò<®Ã<«·c+
+Ep|i¡c R{|_<(\ûizÖK÷FÌËýùVõ¾ûöåûgmònÀ9ýCë|çòye,»¾~
+rùR_
q¦ÇüWÛc>ÒÎ`ýÓç`ÿoñ6ä7Óó[¤Dim¼¦Ç㺩Ü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ãúUxê¯Ç ÞÒ¸Ö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#ÑÝè³ÈÝHn"#Ñd®e7cqÀU³Hè1 ¹¸ Ýû%7XèÖ/¹<æ¹{Zñ;JÎnB#iÀ§¡O/Éy at r5Òôp3¼{
+$/±¡M/W±AD^îìãËø;YMÉäð<ø#Ú^Ã|I¯ *©\Î(9°
+zb³Ïf° L>®a&Cê1g-©LG(ÈÈßë)GýÃ>Ry©¢ nÉ-Cý±Þ2&iJ¢ÈOɨ1uä¤r1Eøu ? ½!>«â@*#¤´Tn" Rþð`óùCk#øCFP1ó)U¤Rª M3oæ|Y©ÈXEÅÅå¯Ç)p®©²0ê qYÄg+4}Ïg«¥ÿ)ÄRïT]}A8Ëú¼0-;OßF³Þíõåard®çëyæÇ\/0CÞæÈú3ìüPò)<Ð'PçY®O÷ÙQÃc§ú¬áþî÷Xº6ÌI Pß?LÃHäÀ¶oèFá¯<&.k¤zwüa;¡^S`
+̸ÇnQIÇ))ã-Âúñð;Á L&Í$C6ÙÿÚàmtsÞwkÕý«÷]jhÇy5õö¬ùý¿<÷±imÚ½lYâR×{Jܵ£6);Ñß¾¼¾z/^0RrÊPgúAÁ°vrMFÒèYÒR:f8wÖd9
+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ÍÉùCQsVÅ,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å02yµÐé#IÛ¼IÛ>xIG'>`2Èæk0¦°ûÝßM¤uõ17v=çr¿ûÝÿý?ÿÿýç;dOÉÄåÅ ADÜ AD$y ÿ"#
¶X«=9[¡4 E^F«4K¦(Jþ0Ûø<*H¨Z¬ÓadÄp«}Õ½zî$îÕ»ðܪ]qu5¹ß®;ì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û翺ÇäÐÛ;»ÚÕzzH ÛÅ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æ7e°ß!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£ëÐunìÛîE(}÷$ØÙæý/"|'n zï_Üì=ý1õß¹4No\
ý½÷{3ê¨^Ý#7û² ÷6à´ö
+ø£"ü·¼¿®=ÍòånØ¿>ñ«¼þ]Wuõò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¸ÔЯQ8×½L WxÔ«Q,*Ö?UQ8oZ¿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}ìªÝ }êMgc7üÙ8ñn®Ç9yãûõÅ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ÿ
+ùÐtz¶xá/Ë/ûsèWoÞ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ë}ÊzeAô©i½LåI~¦1yRLp}L"¥®ÏK¦äF±y©b¹(×Qy©^f©idSî?ÆCöbèý§+Ri´ô^ß|#Dóç+
+TzZ«?d|E²g~ÂéIpÃ^Æ0N0âh²à åBÃ|àuZ¯4¨úQ\èOê`ú«Ò5QiTòݯ'$ýò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ð |òeGq5×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: ItVcT ÕÆâÄÅ(ó
+¤ßYd©¾x X]i~ªpzaxwÞG2ÿ/óðí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