Affymetrix Limma design/contrast matrix
2
0
Entering edit mode
@matthew-hannah-621
Last seen 9.6 years ago
I know this has been asked several times for various designs, and I have searched and read the user guide but I'm getting nowhere fast. I would be very grateful if someone could help me out with what is probably a simple request to someone familar with lm and Limma. I was following 8.4 Estrogen Data: A 2x2 Factorial Experiment with Affymetrix Arrays but have got a bit confused - especially if > cont.matrix <- cbind(E10=c(0,0,1,0),E48=c(0,0,0,1)) is not a typo and should read > cont.matrix <- cbind(E10=c(0,1,0,0),E48=c(0,0,0,1)) Anyway rather than say more than I'm statistically inept, I would appreciate some help on an appropriate design and contrast matrix for the list below. Exp Genotype Treatment MUTA.1 1 MUT A MUTA.2 2 MUT A MUTA.3 3 MUT A MUTA.4 4 MUT A MUTN.1 1 MUT N MUTN.2 2 MUT N MUTN.3 3 MUT N MUTN.4 4 MUT N ConA.1 1 Con A ConA.2 2 Con A ConA.3 3 Con A ConA.4 4 Con A ConN.1 1 Con N ConN.2 2 Con N ConN.3 3 Con N ConN.4 4 Con N I already have it as pData (is there an easy way to adapt this?). I tried this design (is it correct?) but also want it with the experiment included. >treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4), labels=c("MUTA","MUTN","ConA","ConN")) > contrasts(treatments) <- cbind(Treat=c(1,0,1,0),MUT=c(1,1,0,0), Con=c(0,0,1,1)) >design <- model.matrix(~treatments) Then I got very confused with the contrasts - in the example they only look at the estrogen effect, what if you want to make the same contrasts as in the design (eg: also include time in the estrogen example) do you need another fit or do you just use the first one? Basically I want to compare MUTA vs ConA, MUTN vs ConN, A vs N. Getting slightly more complicated the data is paired (eg: MUTA.1 with MUTN.1) and was wondering if this pairwise nature could be taken into account and compare the MUTA-MUTN changes vs ConA-ConN changes? I ask this as I've found that the changes may be more reproducible than the absolute values. Thanks in advance. Matt
limma limma • 978 views
ADD COMMENT
0
Entering edit mode
SAURIN ★ 1.1k
@saurin-799
Last seen 9.6 years ago
Why this error is coming: anyone had this..!!??? > R CMD BATCH Ex_R_Script1.R /usr/local/lib/R/bin/BATCH: line 55: 4686 Broken pipe cat ${in} Thanks bioC, Saurin
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia
At 04:53 AM 23/06/2004, Matthew Hannah wrote: >I know this has been asked several times for various designs, and I >have searched and read the user guide but I'm getting nowhere fast. >I would be very grateful if someone could help me out with what is >probably a simple request to someone familar with lm and Limma. > >I was following >8.4 Estrogen Data: A 2x2 Factorial Experiment with Affymetrix Arrays >but have got a bit confused - especially if > > cont.matrix <- cbind(E10=c(0,0,1,0),E48=c(0,0,0,1)) >is not a typo and should read > > cont.matrix <- cbind(E10=c(0,1,0,0),E48=c(0,0,0,1)) No it is not a typo. >Anyway rather than say more than I'm statistically inept, I would >appreciate some help on an appropriate design and contrast matrix >for the list below. > > Exp Genotype Treatment >MUTA.1 1 MUT A >MUTA.2 2 MUT A >MUTA.3 3 MUT A >MUTA.4 4 MUT A >MUTN.1 1 MUT N >MUTN.2 2 MUT N >MUTN.3 3 MUT N >MUTN.4 4 MUT N >ConA.1 1 Con A >ConA.2 2 Con A >ConA.3 3 Con A >ConA.4 4 Con A >ConN.1 1 Con N >ConN.2 2 Con N >ConN.3 3 Con N >ConN.4 4 Con N > >I already have it as pData (is there an easy way >to adapt this?). I tried this design (is it correct?) but also want >it with the experiment included. > > >treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4), >labels=c("MUTA","MUTN","ConA","ConN")) > > contrasts(treatments) <- cbind(Treat=c(1,0,1,0),MUT=c(1,1,0,0), >Con=c(0,0,1,1)) > >design <- model.matrix(~treatments) > >Then I got very confused with the contrasts - in the example they only >look at the estrogen effect, what if you want to make the same contrasts >as in the design (eg: also include time in the estrogen example) do you >need another fit or do you just use the first one? No you only need one fit. >Basically I want to compare MUTA vs ConA, MUTN vs ConN, A vs N. Perhaps the easiest for you is to use the makeContrasts() function: treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)) design <- model.matrix(~ 0+treatments) colnames(design) <- c("MUTA","MUTN","ConA","ConN") fit <- lmFit(eset, design) cont.matrix <- makeContrasts(MUTA-ConA, MUTN-ConN, AvsN=(MUTA+ConA-MUTN-ConN)/2, levels=design) fit2 <- contrasts.fit(fit, cont.matrix) fit2 <- eBayes(fit2) >Getting slightly more complicated the data is paired (eg: MUTA.1 with >MUTN.1) and was wondering if this pairwise nature could be taken into >account and compare the MUTA-MUTN changes vs ConA-ConN changes? I ask >this as I've found that the changes may be more reproducible than the >absolute values. Now you are asking something which is a methodological research question, and you really should consider taking on a statistician as a full collaborator. Gordon >Thanks in advance. >Matt
ADD COMMENT

Login before adding your answer.

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