I have a question regarding batch effect correction with LIMMA. I have some proteomics data, and when I do my PCA plot I see that samples cluster by patient rather than my treatment (I have three samples per patient, each sample with a different treatment). For this reason I would like to include patient as a batch effect in my linear model (rather than use removebatcheffects because I then want to perform differential analysis with LIMMA).
My plan was to use the following:
design = model.matrix(~0+Patient+Treatment, data=metadata) fit1 = lmFit(log2all.df.filter,design = design) cont <- makeContrasts(TreatmentCombo-TreatmentControl, TreatmentCombo-TreatmentLipid, TreatmentLipid-TreatmentControl, levels = design) fit2 = contrasts.fit(fit1,contrasts = cont) fit3 <- eBayes(fit2)
This does work, however when I view my design instead of my five patients, there are only four listed in the design table.
Similarly if I change the order of the design to:
design = model.matrix(~0+Treatment+Patient, data=metadata)
and view the design, there are only two treatments included in the design instead of the three treatments that I have (so I can't proceed with my DE analysis).
Is anyone aware of a solution to this? Any help is much appreciated!
Many thanks, Sandra