How can I overcome the error of "No residual degrees of freedom in linear model fits"?
1
0
Entering edit mode
@jurat-shahidin-9488
Last seen 18 months ago
Chicago, IL, USA

Hi:

I am experimenting preprocessed Affymetrix microarrays expression data matrix (Affymetrix probe-sets in rows (32830 probesets), and RNA samples in columns (735 samples)) for my downstream analysis. However, I have pheno metadata for the experiment observations.

data that I used:

> dim(eset_HTA20)
[1] 32830   735
> eset_HTA20[1:3, 1:3]
Tarca_001_P1A01 Tarca_003_P1A03 Tarca_004_P1A04
1_at          6.062215        6.125023        5.875502
10_at         3.796484        3.805305        3.450245
100_at        5.849338        6.191562        6.550525

> dim(phenoDat)
[1] 735   7
> phenoDat[1:3,]
SampleID   GA Batch     Set Train Platform
Tarca_001_P1A01 Tarca_001_P1A01 11.0     1 PRB_HTA     1    HTA20
Tarca_003_P1A03 Tarca_013_P1B01 15.3     1 PRB_HTA     1    HTA20
Tarca_004_P1A04 Tarca_025_P1C01 21.7     1 PRB_HTA     1    HTA20
T
Tarca_001_P1A01 Preterm
Tarca_003_P1A03 Preterm
Tarca_004_P1A04 Preterm


my attempt:

I tried differential expression analysis on eset_HTA20 data, here is my workflow by using limma package:

ano <- phenoDat
esetHTA <- HTA20_rma_filt

ano$ID <- factor(ano$SampleID)
designs <- model.matrix(~0+T+SampleID, ano)
esets <- eset_HTA20[, rownames(ano)]
colnames(designs)<-substr(colnames(designs),2,100)
fit <- lmFit(esets, designs)
cont.matrix <- makeContrasts( contrasts="Term-Preterm",levels=designs)
fit2 <- contrasts.fit(fit, cont.matrix)
fit2 <- eBayes(fit2)


but when I ran fit2 <- eBayes(fit2), I got the following error:

> fit2 <- eBayes(fit2)
Error in .ebayes(fit = fit, proportion = proportion, stdev.coef.lim = stdev.coef.lim,  :
No residual degrees of freedom in linear model fits


I looked into support site here and Gordon explained several threads that this happened if data doesn't have replicate. I am not quite sure how to proceed with my analysis now. How can I know data have replicates or not? If there is not replicate, what's the possible solution to go through with this issue? can anyone point me out any possible strategy I could try here? any thought?

limma microarray error • 391 views
2
Entering edit mode
Dario Strbenac ★ 1.5k
@dario-strbenac-5916
Last seen 7 days ago
Australia

I suppose that there is a distinct sample ID for each of your 735 samples. You don't want to have SampleID as a term in your model formula. You ought to include Batch, though.

0
Entering edit mode

bingo, I just fixed this by taking your opinion, but why I should include Batch instead of SampleID? I am a newbie for differential expression analysis, so this is not crystal clear to me yet. Could you give extended comments on your proposal? I want to learn? what else I have to try for designs matrix? any idea?

0
Entering edit mode

To be blunt, this is not a set to use learn on. It's way too large and complex. If you don't understand why batch should be a category and sample ID should not, you need to practice with tutorials and much smaller sets so that you understand the basics of what you are doing.