]> git.donarmstrong.com Git - rsem.git/blob - EBSeq/man/DenNHist.Rd
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / man / DenNHist.Rd
1 \name{DenNHist}
2 \alias{DenNHist}
3 %- Also NEED an '\alias' for EACH other topic documented here.
4 \title{
5 %%  ~~function to do ... ~~
6 Density plot to compare th empirical q's and the simulated q's from the fitted beta distribution.
7 }
8 \description{
9 %%  ~~ A concise (1-5 lines) description of what the function does. ~~
10 }
11 \usage{
12 DenNHist(QList, Alpha, Beta, name, AList = "F", GroupName)
13 }
14 %- maybe also 'usage' for other objects documented here.
15 \arguments{
16   \item{QList}{
17 The estimated q's from the output of NBBetaEB.bias.uniqueP_PoolVarSpeedUp_MDFPoi_NoNormVar
18 . Input could be a vector or a list of different groups of transcripts. The number of lists here should be the same as the length of Beta.
19
20 }
21   \item{Alpha}{
22 The fitted parameter alpha from the output of NBBetaEB.bias.uniqueP_PoolVarSpeed
23 Up_MDFPoi_NoNormVar. Input should be a number if AList is not defined.
24 }
25   \item{Beta}{
26 The fitted parameter beta from the output of NBBetaEB.bias.uniqueP_PoolVarSpeedUp_MDFPoi_NoNormVar. 
27 Input could be one single number or a vector of several numbers. The length of the input should be the same as the number of lists of QList.
28
29 }
30   \item{name}{
31 The name of the plots
32 }
33   \item{AList}{
34 Whether a list of alpha's are used
35
36 }
37   \item{GroupName}{
38 The names of each sub plot. The l
39 ength of the input should be the same as the number of lists of QList.
40
41 }
42 }
43 \details{
44 %%  ~~ If necessary, more details than the description above ~~
45 }
46 \value{
47 Plots will be generated. Each plot represents a sub-list of the QList.
48 The empirical estimation of q's will be represented as blue histogram and the density of
49 the fitted beta distribution will be represented as the green line.
50 The main title of the plot will be "GroupName name".
51
52 }
53 \references{
54 %% ~put references to the literature/web site here ~
55 }
56 \author{
57 Ning Leng
58 }
59 \note{
60 %%  ~~further notes~~
61 }
62
63 %% ~Make other sections like Warning with \section{Warning }{....} ~
64
65 \seealso{
66 beta.mom, DenNHistTable, QQP, NBBetaEB.bias.uniqueP_PoolVarSpeedUp_MDFPoi_NoNormVar
67 }
68 \examples{
69 ### Simulate Gene Level Data
70 GeneGenerate=GeneSimu(DVDconstant=4, DVDqt1=NULL, DVDqt2=NULL, Conditions=rep(c(1,2),each=5), NumofSample=10, NumofGene=10000, DEGeneProp=.1, Phiconstant=NULL, Phi.qt1=.25, Phi.qt2=.75, Meanconstant=NULL, OnlyData="Y")
71 GeneData=GeneGenerate$data
72
73 # Run EBSeq
74 EBres=NBBetaEB.bias.uniqueP_PoolVarSpeedUp_MDFPoi_NoNormVar(Data=GeneData, NgVector=rep(1,10^4), Vect5End=rep(1,10^4), Vect3End=rep(1,10^4), Conditions=as.factor(rep(c(1,2),each=5)), sizeFactors=rep(1,10),maxround=5)
75 # Plot
76 DenNHist(QList=EBres$QList1, Alpha=EBres[[1]][5,1], Beta=EBres[[2]][5,1], name="Gene", AList="F", GroupName="")
77
78 ### Simulate Isoform Level Data
79 IsoGenerate=IsoSimu(DVDconstant=NULL, DVDqt1=.97, DVDqt2=.98, Conditions=as.factor(rep(c(1,2),each=5)), NumofSample=10, NumofIso=NULL, DEIsoProp=.1, Phiconstant=NULL, Phi.qt1=.25, Phi.qt2=.75, OnlyData="Y" )
80 IsoList=IsoGenerate$data
81
82 # Get Vectors and Run EBSeq
83 ngv=c(1,2,3,2,3,2,3,2,3)
84 b3v=c(1,0,0,1,1,0,0,1,1)
85 b5v=c(1,0,0,0,0,1,1,1,1)
86 NgV=unlist(sapply(1:9,function(i)rep(ngv[i],dim(IsoList[[i]])[1])))
87 Bias3V=unlist(sapply(1:9,function(i)rep(b3v[i],dim(IsoList[[i]])[1])))
88 Bias5V=unlist(sapply(1:9,function(i)rep(b5v[i],dim(IsoList[[i]])[1])))
89
90 IsoData=do.call(rbind,IsoList)
91 IsoEBres=NBBetaEB.bias.uniqueP_PoolVarSpeedUp_MDFPoi_NoNormVar(Data=IsoData, NgVector=NgV, Vect5End=Bias5V, Vect3End=Bias3V, Conditions=as.factor(rep(c(1,2),each=5)),sizeFactors=rep(1,10), maxround=5)
92
93 # Plot
94 par(mfrow=c(3,3))
95 DenNHist(QList=IsoEBres$QList1, Alpha=IsoEBres[[1]][5,], Beta=IsoEBres[[2]][5,], name="Isoform", AList="F", GroupName=paste("group",c(1:9),sep=""))
96
97
98
99
100
101
102
103 }
104 % Add one or more standard keywords, see file 'KEYWORDS' in the
105 % R documentation directory.
106 \keyword{ beta }
107 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line