Gene set analysis with CAMERA
3
0
Entering edit mode
krishna312 • 0
@krishna312-6866
Last seen 6.1 years ago
Finland

Hi, I would be thankful for replies to my question related to gene set analysis with camera. Following is the problem:

Consider the example given on camera help page (?camera).

y <- matrix(rnorm(1000*6),1000,6)
design <- cbind(Intercept=1,Group=c(0,0,0,1,1,1))

# First set of 20 genes are genuinely differentially expressed
index1 <- 1:20
y[index1,4:6] <- y[index1,4:6]+1

# Second set of 20 genes are not DE
index2 <- 21:40

camera(y, list(set1=index1,set2=index2), design)

The above example deals with comparison of two sample groups as one can see in the object, design.

I have more than two sample groups and I want to compare for example group 2 and group 3. So, the group = c(1,1,2,2,3,3).

How to build design matrix for such comparison and what to supply to "contrast" parameter?

limma gene set analysis camera • 4.4k views
3
Entering edit mode
@aliaksei-holik-4992
Last seen 6.5 years ago
Spain/Barcelona/Centre for Genomic Reguâ€¦

Presuming you have already done differential expression analysis with limma or edgeR, your design matrix and contrasts for the camera are the same. I would suggest checking out limma user guide: http://www.bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf

Since you can't use 1, 2 and 3 as group names, as they are not syntactically valid names in R, say your group labels are actually:

group = as.factor(c("a","a","b","b","c","c"))

des <- model.matrix(~0+group) colnames(des) <- levels(group)

And the contrast to compare group c vs group b is:

contr <- makeContrasts(c-b, levels = des)

Hope it helps,

Aliaksei.

0
Entering edit mode

Thanks Aliaksei! That helped!!

0
Entering edit mode
krishna312 • 0
@krishna312-6866
Last seen 6.1 years ago
Finland

Thanks a lot Aliaksei! That helped!!