Paired samples and origin question, Limma
1
0
Entering edit mode
Morten ▴ 300
@morten-929
Last seen 10.2 years ago
Hello everyone, First: Im really sorry for posting this because Ive found several topics in the mail archive, but I cant seem to get any smarter. Backgound: I have 6 patients which cells have been divided into two groups: annexin positive and annexin negative, thus having 12 samples from 6 patients. In addition the 12 Affymetrix arrays have been produced at two differet labs. I want to correct for the variance introduced by the different labs and biological differences from the repsective patients. As I understand it I can use the block option in lmFit to correct for this. Do the following Limma code correct for the origin of the samples, and how can I add information that the samples are paired by patients ? Should I use an ANOVA model for this instead of a Limma linear model ? design <- model.matrix(~ -1+factor(c(1,1,1,1,1,1,2,2,2,2,2,2))) colnames(design)=c("positive","negative") origin=c(1,1,1,2,2,2,1,1,1,2,2,2) dupcor <- duplicateCorrelation(eset,design,block=origin) fit <- lmFit(eset,design,block=origin,correlation=dupcor$consensus) contrast.matrix <- makeContrasts(positive-negative, levels=design) fit2 <- contrasts.fit(fit, contrast.matrix) fit2 <- eBayes(fit2) To sum up, I want to ask limma this: "Give me DE genes from Annexin positive vs Annexin negative after taking into account that the samples are paired patient and location wise" be gentle with me. Im only a biologist :) morten
limma limma • 2.3k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States
Hi Morten, Morten Mattingsdal wrote: > Hello everyone, > > First: Im really sorry for posting this because Ive found several topics > in the mail archive, but I cant seem to get any smarter. > > Backgound: I have 6 patients which cells have been divided into two > groups: annexin positive and annexin negative, thus having 12 samples > from 6 patients. In addition the 12 Affymetrix arrays have been produced > at two differet labs. I want to correct for the variance introduced by > the different labs and biological differences from the repsective > patients. As I understand it I can use the block option in lmFit to > correct for this. > > Do the following Limma code correct for the origin of the samples, and > how can I add information that the samples are paired by patients ? > Should I use an ANOVA model for this instead of a Limma linear model ? Well, limma linear models _are_ ANOVA models. Any time you specify the independent variables as factors (as you do in your model.matrix() call below), you are by default doing ANOVA. In your case, you have two blocking variables (lab and patient), so you are going to have to handle the patient pairing by hand. Remember that a paired t-test involves the difference of the pairs divided by the standard error of that difference. If you pre-compute the differences and then fit a model with just one factor level, but with blocks, then you should get what you are looking for. So, assuming that I deduced the pairs correctly from your code, paired <- exprs(eset)[,1:6] - exprs(eset)[,7:12] origin <- rep(1:2, each = 3) dupcor <- duplicateCorrelation(paired, block = origin) fit <- lmFit(paired, block = origin, correlation = dupcor$cons) fit2 <- eBayes(fit2) If you don't specify a design matrix, you will by default get a vector of ones, indicating that the samples are all the same and you are testing to see if there is any difference between the mean of the samples (in your case the paired differences) and zero, which is what a paired t-test does. > > design <- model.matrix(~ -1+factor(c(1,1,1,1,1,1,2,2,2,2,2,2))) > colnames(design)=c("positive","negative") > origin=c(1,1,1,2,2,2,1,1,1,2,2,2) > dupcor <- duplicateCorrelation(eset,design,block=origin) > fit <- lmFit(eset,design,block=origin,correlation=dupcor$consensus) > contrast.matrix <- makeContrasts(positive-negative, levels=design) > fit2 <- contrasts.fit(fit, contrast.matrix) > fit2 <- eBayes(fit2) > > To sum up, I want to ask limma this: "Give me DE genes from Annexin > positive vs Annexin negative after taking into account that the samples > are paired patient and location wise" > > be gentle with me. Im only a biologist :) This reminds me of a quote I heard concerning a local (foreign born) PI. "Arrgh! Must I do all the thinking in this lab? I buy whip!!" Let this be a warning to you ;-D Best, Jim > morten > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD COMMENT
0
Entering edit mode
Dear list, I am using the qvalue package and I do not want to use the GUI, but I am having some trouble turning off the tcltk widget. I tried the following code, but it doesn't work. > qobj<- qvalue(fit.all$p.value.Ad.E2_4h, gui=FALSE) Can someone tell me how to turn the GUI off? Thanks very much, Edmund Chang
ADD REPLY
0
Entering edit mode
Hello Morton, >> ... >> I want to correct for the variance introduced by the different >> labs and biological differences from the repsective patients. >> As I understand it I can use the block option in lmFit to >> correct for this. >> >> Do the following Limma code correct for the origin of the samples, >> and how can I add information that the samples are paired by patients ? > ... > In your case, you have two blocking variables (lab and patient), so > you are going to have to handle the patient pairing by hand. Based on Gordons reply to a similar question, limma should be able to handle it: lab with blocking and patient as a fixed effect: https://stat.ethz.ch/pipermail/bioconductor/2005-March/007864.html Regards Gerhard
ADD REPLY

Login before adding your answer.

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