]> git.donarmstrong.com Git - rsem.git/blob - EBSeq/man/EBMultiTest.Rd
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / man / EBMultiTest.Rd
1 \name{EBMultiTest}
2 \alias{EBMultiTest}
3 %- Also NEED an '\alias' for EACH other topic documented here.
4 \title{
5 Using EM algorithm to calculate the posterior probabilities of interested patterns in multiple condition study
6 }
7 \description{
8 Base on the assumption of NB-Beta Empirical Bayes model, the EM algorithm is used to get the posterior probability of interested patterns.
9 }
10 \usage{
11 EBMultiTest(Data,NgVector=NULL,Conditions,AllParti=NULL, sizeFactors, maxround, tau=NULL,CI=NULL,CIthre=NULL, Pool=F, NumBin=1000, Approx=10^-10,PoolLower=.25, PoolUpper=.75)
12 }
13 %- maybe also 'usage' for other objects documented here.
14 \arguments{
15
16   \item{Data}{
17 A data matrix contains expression values for each transcript .(Gene level or Isoform level.). In which rows should be transcripts and columns should be samples.
18 }
19   \item{NgVector}{
20 A vector contains the Ng value of each isoform. If the isoform is in a gene with 2 isoforms, Ng should be 2. Ng could be only 1, 2 or 3. If it's gene level data, Ngvector should all be 1. The vector length should be the same as the number of rows in Data.
21 }
22   \item{Conditions}{
23 A vector indicates the condition each sample belongs to. 
24 }
25
26 \item{AllParti}{
27         A matrix indicates the interested patterns. Columns shoule be conditions and rows should be patterns. 
28         The matrix could be obtained by the GetPatterns function. If AllParti=NULL, all possible patterns will be used.
29 }
30
31   \item{sizeFactors}{
32 The normalization factors. 
33 The normalization factors could be a vector with lane specitic numbers.
34 Or it could be a matrix with lane and transcript specific numbers.
35 }
36   \item{maxround}{
37 Number of iterations. The suggested value is 5.
38 }
39
40 \item{tau}{
41 The tau value from RSEM output. If the data has no replicates within condition, 
42 EBSeq will use the CI of tau to capture the variation from mapping
43 uncertainty and estimate the variance.
44         }
45 \item{CI}{
46 The CI of each tau from RSEM output     
47         }
48 \item{CIthre}{
49 The threshold of CI RSEM used.
50         }
51 \item{Pool, NumBin}{
52 Working without replicates, we should define the Pool=T in the
53  EBTest function to enable pooling.
54 By defining NumBin = 1000, EBSeq will group the genes with similar means
55 together into 1,000 bins.
56 With the assumption that no more than 50\% genes are DE in the data set,
57 We take genes whose FC are in the 25\% - 75\% quantile of the FC's  as the
58 candidate genes.
59 For each bin, the bin-wise variance estimation would be the median of the
60 cross condition variance estimations of the candidate genes within that bin.
61 We use the cross condition variance estimations for the candidate genes
62 and the bin-wise variance estimations of the host bin for the non-candidate genes.
63 }
64
65 }
66
67 \details{
68 For each transcript gi within condition, the model assumes:
69 X_gis|mu_gi ~ NB (r_gi0 * l_s, q_gi)
70 q_gi|alpha, beta^N_g,b_gi ~ Beta (alpha, neta^N_g,b_gi)
71 In which the l_s is the sizeFactors of sample s.
72
73 The function will test:
74 H0: q_giC1 = q_giC2
75 H1: q_giC1 != q_giC2
76
77
78 }
79 \value{
80 \item{Alpha }{Fitted parameter alpha of the prior beta distribution. Rows are the values for each iteration.}
81 \item{Beta }{Fitted parameter beta of the prior beta distribution. Rows are the values for each iteration.}
82 \item{P, PFromZ }{ The bayes estimator of being DE.Rows are the values for each iteration.}
83 \item{Z, PoissonZ}{ The Posterior Probability of being DE for each transcript. (Maybe not in the same order of input)}
84 \item{RList}{ The fitted values of r for each transcript.}
85 \item{MeanList}{The mean of each transcript. (Cross conditions)}
86 \item{VarList}{The variance of each transcript. (Cross conditions, using the expression values devided by it's sizeFactors)}
87 \item{QListi1}{The fitted q values of each transcript within condition 1.}
88 \item{QListi2}{The fitted q values of each transcript within condition 2.}
89 \item{C1Mean}{The mean of each transcript within Condition 1}
90 \item{C2Mean}{The mean of each transcript within Condition 2}
91 \item{C1EstVar}{The estimated variance of each transcript within Condition 1}
92 \item{C2EstVar}{The estimated variance of each transcript within Condition 2}
93 \item{PoolVar}{The variance of each transcript. (The pooled value of within condition EstVar)}
94 \item{DataList}{A List of data that grouped with Ng and bias.}
95 \item{PPDE}{The Posterior Probability of being each pattern for each transcript. (The same order of input)}
96 \item{f}{The likelihood of predictive distribution of being each pattern for each transcript. }
97 \item{AllParti}{The matrix describe the patterns}
98 }
99 \references{
100 }
101 \author{
102 Ning Leng
103 }
104 \note{
105 }
106
107
108 \seealso{
109 }
110 \examples{
111 Conditions=c("C1","C1","C2","C2","C3","C3")
112 PosParti=GetPatterns(Conditions)
113 AllParti=PosParti[-3,]
114
115 MultiData=GeneMultiSimu(Conditions=Conditions,AllParti=AllParti,
116                                                                         NumofSample=6,NumofGene=1000,DEGeneProp=c(.7,.1,.1,.1),
117                                                                                                                         DVDqt1=.98,DVDqt2=.99,Phi.qt1=.25,Phi.qt2=.75)
118
119 MultiRes=EBMultiTest(MultiData[[1]],NgVector=NULL,Conditions=Conditions,
120                                                               AllParti=AllParti, sizeFactors=rep(1,6), maxround=5, tau=NULL,CI=NULL,
121                                                                                                CIthre=NULL, Pool=F, NumBin=1000, Approx=10^-10,PoolLower=.25, PoolUpper=.75)
122 MultiPP=GetMultiPP(MultiRes)
123
124 sum(MultiPP$MAP==MultiData[[2]])
125
126 }
127 % Add one or more standard keywords, see file 'KEYWORDS' in the
128 % R documentation directory.
129 \keyword{ ~kwd1 }
130 \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line