How to do contrasts in CAMERA/ROMER/ROAST/etc in Limma?
1
0
Entering edit mode
chris86 ▴ 420
@chris86-8408
Last seen 4.4 years ago
UCL, United Kingdom

Hi

I am trying to get a camera test working after my differential expression in limma. I do not know how to set up camera properly here, because contrast 1,2,3 is not the same as co efficients 1,2,3 in my DE analysis - because the results are not right. I am stuck, any words of wisdom?

colnames(design) <- c('class1', 'class2', 'class3', 'age', 'gender')
matrix <- data.matrix(data3)
fit <- lmFit(matrix, design)
contrast.matrix <- makeContrasts(class1-class2, class3-class2, class3-class1, levels=design)
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)
anova <- topTableF(fit2, number=Inf)

top2 <- topTable(fit2,coef=3,number=Inf,sort.by="P") # I choose my comparisons here

# parse .gmt files

setwd("~/Desktop/gmt_files")
x <- scan("c2.cp.kegg.v5.0.symbols.gmt", what="", sep="\n")
y <- strsplit(x, "[[:space:]]+")
names(y) <- sapply(y, `[[`, 1)
y <- lapply(y, `[`, -1)

c2.indices <- ids2indices(y, row.names(data3))
results <- camera(data3, c2.indices, design,contrast=3) # this is the bit I am not sure about

Thanks,

Chris

limma • 764 views
ADD COMMENT
3
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 11 hours ago
The city by the bay

Presumably you want to run CAMERA on the third comparison in contrast.matrix. If so, then you can do:

results <- camera(data3, c2.indices, design, contrast=contrast.matrix[,3])

This will use the DE between classes 1 and 3, same as the DE identified inĀ top2.

ADD COMMENT
0
Entering edit mode

thanks again Aaron

ADD REPLY

Login before adding your answer.

Traffic: 1011 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