=== Please help ======== This is was a code used to analyze DEG of an microarray data All steps are working fine But error in the final step while trying to write the result to .txt file
ERROR
> write.fit(fit2, file = "de-results.txt",adjust="BH")
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 21801, 27416
library(GEOquery)
library(limma)
filenm <- "GSE39956_series_matrix.txt.gz"
gse <- getGEO(filename=filenm)
gse
head(exprs(gse))
boxplot(exprs(gse),outline=FALSE)
pd <- pData(gse)
library(genefilter)
design <- matrix(nrow=21,ncol=2)
design[,1] <- c(1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
design[,2] <- c(0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
colnames(design) <- c("Control","Salt300")
gse.expFilt <- varFilter(gse)
fit <- lmFit(exprs(gse.expFilt), design)
names(fit)
dim(fit$coefficients)
head(fit$coefficients)
contrasts <- makeContrasts(logFC = Salt300 - Control, levels=design)
fit2 <- contrasts.fit(fit, contrasts)
head(fit2$coeff)
fit2 <- eBayes(fit2)
fit2
topTable(fit2)
library(org.At.tair.db)
anno <- data.frame(SYMBOL=sapply(contents(org.At.tairSYMBOL), paste, collapse=", "), DESC=sapply(contents(org.At.tairGENENAME), paste, collapse=", "))
fit2$genes <- anno
topTable(fit2)
decideTests(fit2)
table(decideTests(fit2))
sum(abs(decideTests(fit2))==1)
volcanoplot(fit2)
volcanoplot(fit2,highlight=10,names = fit2$genes$"Symbol")
write.fit(fit2, file = "control_salt300.txt",adjust="BH")