Dear Babumanish837,
what do you mean that you know to use t.test for two features ?
lets say you have the two groups you mentioned.
e <- exprs(eset) # your expression set
test <- do.call("rbind", lapply(rownames(e), function(x) t.test(e[x,Index2], e[x,Index1])[c("estimate","statistic","p.value")])) # where Index2 and Index1 represent the indices-columns of the samples belonging to your group (and optional paired=TRUE if you want paired analysis). And this will return for each probeset the according statistics.
But anyway, you should perform limma analysis. You can use then topTable to get your DE probesets according to your criteria, and as topTable returns a data.frame, you could order and subset your results:
i.e. study <- factor(rep(c("A","B"),each=6)) # lets say your factor indicating your groups is called study
design <- model.matrix(~study)
fit <- lmFit(eset, design)
fit2 <- eBayes(fit)
selected <- topTable(fit2, coef=2, number=nrow(fit2), adjust.method="fdr", sort.by="none")
and then subset by any values you want: for example, selected_2 <- subset(selected, select=c(t,logFC,adjusted.P.Val))
and finally order for instanse by the moderated t.statistic :
ordered <- selected_2[order(abs(subset$t), decreasing=TRUE),][1:200,] # to keep the top200 probesets with the biggest moderated t.statistic
I hope this helps !!
The genefilter package implements rowttest
Dear @svlachavas,
Thanks for your help,
Could you please explain what is group in the statement
design <- model.matrix(~group)
Dear svlachavas,
Now i understand group is nothing but study. It solved my problem. But i have one question what is the significance of ~ in design <- model.matrix(~group).
Thank You very much for your help.
Dear Babumanish,
just know i saw your answers. By accident i used after the name group and it is study. Im going to correct it immediately