]> git.donarmstrong.com Git - rsem.git/blob - EBSeq/man/TPFDRplot.Rd
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / man / TPFDRplot.Rd
1 \name{TPFDRplot}
2 \alias{TPFDRplot}
3 %- Also NEED an '\alias' for EACH other topic documented here.
4 \title{
5 Plot the number of top counts vs FDR for each method in simulation data
6 }
7 \description{
8 %%  ~~ A concise (1-5 lines) description of what the function does. ~~
9 }
10 \usage{
11 TPFDRplot(DESeqP, EBZ, TrueDE, main, FDR = NULL)
12 }
13 %- maybe also 'usage' for other objects documented here.
14 \arguments{
15   \item{DESeqP}{
16 %%     ~~Describe \code{DESeqP} here~~
17 }
18   \item{EBZ}{
19 %%     ~~Describe \code{EBZ} here~~
20 }
21   \item{TrueDE}{
22 %%     ~~Describe \code{TrueDE} here~~
23 }
24   \item{main}{
25 %%     ~~Describe \code{main} here~~
26 }
27   \item{FDR}{
28 %%     ~~Describe \code{FDR} here~~
29 }
30 }
31 \details{
32 %%  ~~ If necessary, more details than the description above ~~
33 }
34 \value{
35 %%  ~Describe the value returned
36 %%  If it is a LIST, use
37 %%  \item{comp1 }{Description of 'comp1'}
38 %%  \item{comp2 }{Description of 'comp2'}
39 %% ...
40 }
41 \references{
42 %% ~put references to the literature/web site here ~
43 }
44 \author{
45 %%  ~~who you are~~
46 }
47 \note{
48 %%  ~~further notes~~
49 }
50
51 %% ~Make other sections like Warning with \section{Warning }{....} ~
52
53 \seealso{
54 %% ~~objects to See Also as \code{\link{help}}, ~~~
55 }
56 \examples{
57 ##---- Should be DIRECTLY executable !! ----
58 ##-- ==>  Define data, use random,
59 ##--    or do  help(data=index)  for the standard data sets.
60
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]]
77
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)
82                 
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)
87         }
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"))
91
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"))
95
96
97         output=cbind( DETPR,EBTPR, DEFDR,EBFDR,DETPNum,EBTPNum,DEFDNum,EBFDNum)
98   }
99 }
100 % Add one or more standard keywords, see file 'KEYWORDS' in the
101 % R documentation directory.
102 \keyword{ ~kwd1 }
103 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line