Question: limma experimental design
gravatar for christopher.clarskon15
2.5 years ago by
christopher.clarskon1520 wrote:

I am not sure how to model the microarray dataset (10226 obs. of  120 variables). I have been given a microarray dataset where the groups are divided up into different types of TB patients with different disease states: 

Culture confirmed TB,  Culture negative TB,      healthy contact,          healthy LTBI,      Other diagnoses,

                        18                        35                         12                           11                                 44 

I am trying to distill DE ncRNAs in the TB patients. Thus far, I have the actual microarray data and an information file read into a variable called "clinical". Clinical contains a column that specifies each sample label ID e.g. "35-801197" while another details the corresponding "Culture confirmed" category of the sample's disease condition.

Initially I considered labelling the columns of the microarray data variable with the sample label IDs as follows:

"ptr <- match( colnames(E.ncRNA), paste('X',clinical$ncRNA.array.ID,sep='') )

colnames(E.ncRNA) <- clinical$Sample.label[ptr]"

But then I considered that if I want to distinguish DE ncRNAs based on the disease state:

"ptr <- match( colnames(E.ncRNA), paste('X',clinical$ncRNA.array.ID,sep='') )

colnames(E.ncRNA) <- clinical$Sample.label[ptr]"

When I tried making a design matrix and fitting a linear model to this relabelled dataset (as follows), in either case, I got the following errors:

>grouping <- factor(sub(" ", "", clinical2$Diagnostic.category))

> design <- model.matrix(~0 + grouping)

Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 

  contrasts can be applied only to factors with 2 or more levels

> colnames(design) <- levels(grouping)


I'm pretty inexperienced with limma but I was hoping someone could point me in the right direction in terms of experimental design and code.


ADD COMMENTlink modified 2.5 years ago by Gordon Smyth35k • written 2.5 years ago by christopher.clarskon1520
gravatar for Gordon Smyth
2.5 years ago by
Gordon Smyth35k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth35k wrote:

Dear Chris,

You have already received considerable help from me and Aaron Lun in response to your previous post on this same analysis:

  designing matrices practice

The fact is that you haven't yet succeeded in doing the first thing that I advised you to do, which was to create a targets frame. According to your code, the variable 'grouping' is supposed to indicate which group each sample belongs to. If however you check what the variable actually contains, you will find that it doesn't.

You are trying to do a basic DE analysis between a number of groups, and the limma User's Guide already tells you everything you need to know about that. The question you are asking here is actually a basic R programming question. You haven't even got to the limma part yet.

I am pretty sure that the variable 'clinical2$Diagnostic.category' that appears in your code doesn't even exist in your R session. Hence 'grouping' will be of zero length, and hence you get the error from model.matrix(). But why should I have to guess this anyway? Checking your own code is your own responsibility. When you get an error from the R, you should look at the command that gave the error and check the variables you input to that command. That would be quicker and more constructive than posting off the same question simultaneously to my email address, to Bioconductor and to Stackoverflow. It seems in fact that you emailed the above question to every one of the limma authors individually last night, telling each of them that you hadn't managed to get any help from anyone else. Jeez.

Is this an undergraduate project? You don't seem entirely familiar with the data you are trying to analyze. Do you have supervisors who are assigned to help you?

Best wishes


ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Gordon Smyth35k
gravatar for Steve Lianoglou
2.5 years ago by
Steve Lianoglou12k wrote:

Make yourself a pot of coffee and sit down to read through the limmaUsersGuide. It explains all of these things in great detail.


ADD COMMENTlink written 2.5 years ago by Steve Lianoglou12k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 145 users visited in the last hour