Search
Question: Gene set analysis with CAMERA
0
gravatar for krishna312
3.1 years ago by
krishna3120
Finland
krishna3120 wrote:

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?

Thanks in advance!

ADD COMMENTlink modified 2.6 years ago by Gordon Smyth32k • written 3.1 years ago by krishna3120
3
gravatar for Aliaksei Holik
3.1 years ago by
Spain/Barcelona/Centre for Genomic Regulation
Aliaksei Holik350 wrote:

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"))

Then your design matrix is:

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.

ADD COMMENTlink written 3.1 years ago by Aliaksei Holik350

Thanks Aliaksei! That helped!!

ADD REPLYlink written 3.1 years ago by krishna3120
0
gravatar for krishna312
3.1 years ago by
krishna3120
Finland
krishna3120 wrote:

Thanks a lot Aliaksei! That helped!!

ADD COMMENTlink written 3.1 years ago by krishna3120
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 98 users visited in the last hour