A running limma analysis of a dataset, and I got an error in the final step, eBayes(fit2)
This is my code
i <- pData(eset)$Sample_title
Part <- ifelse(pData(eset)$Part == "Tn", "nT", "T")
Grade <- ifelse(pData(eset)$Grade == "Low", "nH", "H")
sample_byGrade <- factor(paste(Grade, Part, sep="."))
design_Grade <- model.matrix(~ 0 + sample_byGrade)
colnames(design_Grade) <- levels(sample_byGrade)
corfit <- duplicateCorrelation(eset,design_Grade,block = i)
contrast_matrix_Grade<- makeContrasts(HighVsLowinT = H.T-nH.T, HighVsLowinnT = H.nT-H.nT,
TVsnTinHigh = H.T-H.nT, TVsnTinLow = nH.T-nH.nT,
levels = design_Grade)
fit <- lmFit(eset,design = design_Grade,block = i, correlation = corfit$consensus)
The error message:
Error in eigen(cor.matrix, symmetric = TRUE) :
infinite or missing values in 'x'
Besides: Warning messages:
1: In ebayes(fit = fit, proportion = proportion, stdev.coef.lim = stdev.coef.lim, :
Estimation of var.prior failed - set to default value
2: In cov2cor(object$cov.coefficients) :
diag(.) had 0 or NA entries; non-finite result is doubtful
I see previous reply and some said that it is possible due to NA in the data. I do anyNA(exprs(eset)) and it is FALSE, and I did do filtering before running LIMMMA so I believe my data got no NA values.
But some of my column in pData(eset) did have NA value, but these columns are not used during this analysis. Where is my problem?