3 %- Also NEED an '\alias' for EACH other topic documented here.
11 TopCts(pvalue, PP = NULL, TrueNames, TopNum)
13 %- maybe also 'usage' for other objects documented here.
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.
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.
26 The names of the transcripts who defined to be DE.
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.
34 %% ~~ If necessary, more details than the description above ~~
37 A metrix contains the FDR's.
40 %% ~put references to the literature/web site here ~
49 %% ~Make other sections like Warning with \section{Warning }{....} ~
52 %% ~~objects to See Also as \code{\link{help}}, ~~~
55 ##---- Should be DIRECTLY executable !! ----
56 ##-- ==> Define data, use random,
57 ##-- or do help(data=index) for the standard data sets.
59 ## The function is currently defined as
60 function(pvalue, PP=NULL, TrueNames, TopNum){
61 NumOfMethods=ncol(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)
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){
72 names(tmp)=rownames(puse)
75 FD[c, s]=FD[(c-1),s]+as.numeric(!names(sorttmp)[c]\%in\%TrueNames)
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)
82 % Add one or more standard keywords, see file 'KEYWORDS' in the
83 % R documentation directory.
85 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line