3 %- Also NEED an '\alias' for EACH other topic documented here.
5 Plot the number of top counts vs FDR for each method in simulation data
8 %% ~~ A concise (1-5 lines) description of what the function does. ~~
11 TPFDRplot(DESeqP, EBZ, TrueDE, main, FDR = NULL)
13 %- maybe also 'usage' for other objects documented here.
16 %% ~~Describe \code{DESeqP} here~~
19 %% ~~Describe \code{EBZ} here~~
22 %% ~~Describe \code{TrueDE} here~~
25 %% ~~Describe \code{main} here~~
28 %% ~~Describe \code{FDR} here~~
32 %% ~~ If necessary, more details than the description above ~~
35 %% ~Describe the value returned
36 %% If it is a LIST, use
37 %% \item{comp1 }{Description of 'comp1'}
38 %% \item{comp2 }{Description of 'comp2'}
42 %% ~put references to the literature/web site here ~
51 %% ~Make other sections like Warning with \section{Warning }{....} ~
54 %% ~~objects to See Also as \code{\link{help}}, ~~~
57 ##---- Should be DIRECTLY executable !! ----
58 ##-- ==> Define data, use random,
59 ##-- or do help(data=index) for the standard data sets.
61 ## The function is currently defined as
62 function(DESeqP, EBZ, TrueDE, main, FDR=NULL){
63 Seq=seq(0.001,0.5,by=0.001)
64 DETPR=rep(0,length(Seq))
65 EBTPR=rep(0,length(Seq))
66 DEFDR=rep(0,length(Seq))
67 EBFDR=rep(0,length(Seq))
68 DETPNum=rep(0,length(Seq))
69 EBTPNum=rep(0,length(Seq))
70 DEFDNum=rep(0,length(Seq))
71 EBFDNum=rep(0,length(Seq))
72 for (i in 1:length(Seq)){
73 DESeqOnes=names(DESeqP)[DESeqP<=Seq[i]]
74 if (length(FDR)==0) EBOnes=names(EBZ)[EBZ>=crit.fun(1-EBZ, Seq[i])]
75 else if (FDR=="H") EBOnes=names(EBZ)[EBZ>=(1-Seq[i])]
76 else EBOnes=names(EBZ)[EBZ>=FDR[i]]
78 DETPNum[i]=sum(DESeqOnes\%in\%TrueDE)
79 EBTPNum[i]=sum(EBOnes\%in\%TrueDE)
80 DEFDNum[i]=sum(!DESeqOnes\%in\%TrueDE)
81 EBFDNum[i]=sum(!EBOnes\%in\%TrueDE)
83 DETPR[i]=DETPNum[i]/length(TrueDE)
84 EBTPR[i]=EBTPNum[i]/length(TrueDE)
85 DEFDR[i]=DEFDNum[i]/length(TrueDE)
86 EBFDR[i]=EBFDNum[i]/length(TrueDE)
88 plot(Seq,DETPR,ylim=c(0,1),xlim=c(0,.5),type="l",col="red", main=paste(main, "TPR"),xlab="controled FDR level", ylab="TPR",lwd=2)
89 lines(Seq,EBTPR,col="blue",lwd=2)
90 legend("bottomright",lwd=2, col=c("red","blue"), c("DESeq","EBSeq"))
92 plot(Seq,DEFDR,ylim=c(0,1),xlim=c(0,.5),type="l",col="red", main=paste(main, "FDR"),xlab="controled FDR level", ylab="TPR",lwd=2)
93 lines(Seq,EBFDR,col="blue",lwd=2)
94 legend("topleft", lwd=2, col=c("red","blue"), c("DESeq","EBSeq"))
97 output=cbind( DETPR,EBTPR, DEFDR,EBFDR,DETPNum,EBTPNum,DEFDNum,EBFDNum)
100 % Add one or more standard keywords, see file 'KEYWORDS' in the
101 % R documentation directory.
103 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line