Question: Contrasts & coefficients in limma
0
18 months ago by
Duke NUS medical school, Singapore
prathap17080 wrote:

Hi, I have a doubt regarding contrasts. In my case, i understood,the 1st coefficient is comparison of MHO with MHNW, 2nd coefficient is comparison of MAO with MHNW and 3rd coefficient is comparison of MAO with MHW . Please let me know, if I understood wrong. Please find my code below.

design.adipose = model.matrix(~0+AdiposeCPMCountGT1_min20percentsamples$samples$group.1+AdiposeCPMCountGT1_min20percentsamples$samples$Gender)

# To rename column names
# To do comparisons between groups
# Voom function v = voom(AdiposeDGE,design.adipose,lib.size = colSums(AdiposeDGE$counts)*AdiposeDGE$samples$norm.factors,normalize.method="quantile",plot = TRUE) ADD COMMENTlink modified 18 months ago by Gordon Smyth37k • written 18 months ago by prathap17080 Answer: Contrasts & coefficients in limma 0 18 months ago by Gordon Smyth37k Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia Gordon Smyth37k wrote: Have you looked at the limma User's Guide, for example Sections 9.1-9.3? You have to fit a linear model and then use contrasts.fit before your contrast matrix will have any effect. At the moment, you don't yet have any coefficients and you haven't yet made any comparisons. To make the comparisons you want, code might go like this: design.adipose <- model.matrix(~0+group.1+Gender, data=AdiposeDGE$samples)
MHOvsMHNW = MHO-MHNW,
MAOvsMHNW = MAO-MHNW,
MAOvsMHO = MAO-MHO,
voom.Results_MHO.vs.MHNW <- topTable(efit,coef="MHOvsMHNW", n=Inf)

and so on.

I did linear modeling fitting and then the contrast was done.I didn't post the last few lines of code in the previous question. Sorry for that. Please see the remaining code here. Thanks for your spontaneous reply.

# Usual limma pipeline
plotSA(efit)
summary(decideTests(efit))

## Access Results
# Examining individual genes from top to bottom

You should use topTable instead of toptable.

Also, you seem to be using two different DGEList data objects, one called AdiposeDGE and the other called AdiposeCPMCountGT1_min20percentsamples. I can't check whether these two datasets match up in terms of sample information. You obviously need to be consistent.

Your code is longer than it needs to be in some respects, but it should work ok.

Thanks prof. The two DGE list objects are same but we removed genes which were expressed very low in the 2nd DGE object.