Hi,
I am analyzing Microarray data using R Bioconductor. I am using the following script. But the problem all the log2fc are in -ve (mostly). I am not sure what's going wrong. Can someone help me to modify it.
library(limma)
targets <- readTargets("affy_targets.txt")
library(affy)
data <- ReadAffy(filenames=targets$FileName)
eset <- rma(data)
pData(eset)
write.exprs(eset, file="(affy_salt_all.txt")
design <- model.matrix(~ -1+factor(c(1,1,2,2,3,3)))
colnames(design) <- c("group1", "group2", "group3")
fit <- lmFit(eset, design)
contrast.matrix <- makeContrasts(group2-group1, group3-group2, group3-group1, levels=design)
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)
topTable(fit2, coef=1, adjust="fdr", sort.by="B", number=10)
write.table(topTable(fit2, coef=1, adjust="fdr", sort.by="B", number=50000), file="limma_salt_complete.xls", row.names=F, sep="\t")
Output
"ID" "logFC" "AveExpr" "t" "P.Value" "adj.P.Val" "B"
"249897_at" 0.602237312171529 5.64509582185098 6.73094814125857 0.00162896558995517 0.876788085929335 -3.5957825791825
"249188_at" 0.44578148174508 7.25973883239111 5.68295138543025 0.00326382351423818 0.876788085929335 -3.65128570595124
.... .... ......... ...... ........... ..........