data(gould)
pattern <- ebPatterns(c("1,1,1,0,0,0,0,0,0,0",
"1,2,2,0,0,0,0,0,0,0"))
gg.em.out <- emfit(gould, family = "GG", hypotheses = pattern, num.iter = 10)
gg.post.out <- postprob(gg.em.out, gould)$pattern
gg.crit <- crit.fun(gg.post.out[,1],0.05)
# number of DE genes
sum(gg.post.out[,2] > gg.crit)
pattern4 <- ebPatterns(c("1, 1, 1, 1, 1, 1, 1, 1, 1, 1",
"1, 2, 2, 2, 2, 2, 2, 2, 2, 2",
"1,2,2,1,1,1,1,1,2,2",
"1,1,1,1,1,1,1,1,2,2"))
gg4.em.out <- emfit(gould, family = "GG", pattern4, num.iter = 10)
gg4.post.out <- postprob(gg4.em.out, gould)$pattern
gg4.crit <- crit.fun(1-gg4.post.out[,2], 0.05)
# number of genes in pattern 2, a DE pattern
sum(gg4.post.out[,2] > gg4.crit)
Run the code above in your browser using DataLab