]> git.donarmstrong.com Git - rsem.git/blob - EBSeq/man/TopCts.Rd
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / man / TopCts.Rd
1 \name{TopCts}
2 \alias{TopCts}
3 %- Also NEED an '\alias' for EACH other topic documented here.
4 \title{
5 Get FDR of Top Counts 
6 }
7 \description{
8
9 }
10 \usage{
11 TopCts(pvalue, PP = NULL, TrueNames, TopNum)
12 }
13 %- maybe also 'usage' for other objects documented here.
14 \arguments{
15   \item{pvalue}{
16 A matrix contains the p values (Posterior probabilities) for each transcript and each method.
17 Rows are for different methods and columns are for different transcripts.
18 }
19   \item{PP}{
20 The length of PP vector should be the same as the number of columns in pvalue matrix.
21 The value in PP either 0 or 1.
22 If the ith value of PP is 0, it means the ith method (the ith row of pvalue) provided p-values.
23 If the ith value of PP is 1, it means the ith method (the ith row of pvalue) provided posterior probabilities. 
24 }
25   \item{TrueNames}{
26 The names of the transcripts who defined to be DE.
27 }
28   \item{TopNum}{
29 The number of top counts we are interested in.
30 For example, if TopNum=1000, we'll calculate the FDR's of each method if we pick the top 1, 2, ... 1000 genes.
31 }
32 }
33 \details{
34 %%  ~~ If necessary, more details than the description above ~~
35 }
36 \value{
37 A metrix contains the FDR's.
38 }
39 \references{
40 %% ~put references to the literature/web site here ~
41 }
42 \author{
43 %%  ~~who you are~~
44 }
45 \note{
46 %%  ~~further notes~~
47 }
48
49 %% ~Make other sections like Warning with \section{Warning }{....} ~
50
51 \seealso{
52 %% ~~objects to See Also as \code{\link{help}}, ~~~
53 }
54 \examples{
55 ##---- Should be DIRECTLY executable !! ----
56 ##-- ==>  Define data, use random,
57 ##--    or do  help(data=index)  for the standard data sets.
58
59 ## The function is currently defined as
60 function(pvalue, PP=NULL, TrueNames, TopNum){
61         NumOfMethods=ncol(pvalue)
62         puse=pvalue
63         if(1\%in\%PP)puse[,PP==1]=1-pvalue[,PP==1]
64         #puse.list=data.frame(puse)
65         FD=matrix(rep(0,NumOfMethods*TopNum),ncol=NumOfMethods)
66 #       Rank=apply(puse,2,rank)
67 #       for(i in 1:TopNum)
68 #               FD[i,]=sapply(1:NumOfMethods, function(j)sum(!rownames(Rank)[Rank[,j]<=i]\%in\%TrueNames))      
69 #       FD=sapply(1:TopNum, function(i)sapply(1:NumOfMethods, function(j)sum(!rownames(Rank)[Rank[,j]<=i]\%in\%TrueNames)))
70         for (s in 1:NumOfMethods){
71                 tmp=puse[,s]
72                 names(tmp)=rownames(puse)
73                 sorttmp=sort(tmp)
74                 for( c in 2:TopNum)
75                         FD[c, s]=FD[(c-1),s]+as.numeric(!names(sorttmp)[c]\%in\%TrueNames)
76         }
77         FD
78         #matplot(TopNum,FD,type="l",ylim=c(0,1),xlab="Top DE selected", ylab="FDR")
79         #legend("rightbottom",col=1:TopNum, lty=1:TopNum, names)
80         }
81 }
82 % Add one or more standard keywords, see file 'KEYWORDS' in the
83 % R documentation directory.
84 \keyword{ ~kwd1 }
85 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line