Creating a design matrix
1
0
Entering edit mode
d808bc07 • 0
@d808bc07
Last seen 3.2 years ago

Hi, I'm trying to create a design matrix for the analysis of differentially expressed genes from microarray data using limma. However, my code generates a matrix with fewer samples than the number of arrays I have in my data frame and therefore I can't run a Bayes fit on this data.

I have some NA's in my data set that does not fit within the levels MU or WT, could this be what's going wrong? and if so can anyone suggest any ideas?

Many thanks!

treatment <- factor(clinical$treatment, levels=c("MU", "WT"))
#clinical is a csv file which cointains details of the microarray (including file names and treatment)
design <- model.matrix(~0+treatment)
limma • 383 views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 13 hours ago
United States

If you have samples that you cannot identify as being in either group, then you by definition cannot use them to make comparisons between the two groups. Because which group are they in?

As you have noted, model.matrix helpfully excludes those samples (as would lm), but you have to manually subset out the offending samples for limma, since you are generating the model matrix separately from fitting the model.

ADD COMMENT

Login before adding your answer.

Traffic: 943 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6