Hi,
Novice users here, with both R in general and bioconductor/limma in particular.
I can perform Affy array data analysis following the tutorials. But I have something too complex for me.
The data set I am working on has multiple groups or treatments. The lab wants to compare between those treatments, which is easy to do. It is also requested to combine groups to a larger one and comparing to another group.
For example, I have A, B, C, D four groups. A is the control, B, C, D are different treatments or treated for different period time. It is easy for me to make contrast table to compare B, C, D to A separately.
Now, if B and C are samples treated with the same reagent, but for different period of time, and I need to compare B+C vs A; also C and D have some thing in common, and I need to make a comparison C+D vs B.
How do make the design and contrast matrix to do all of those. Can I include all of these in one matrix, or I need to make multiple matrix?
Sorry for lacking of better description. I am not familiar with all the right terminology. R is quite different for me, coming from more formal programming languages.
Thanks a lot!
hi @ Aaron Lun, actually I have done the same thing you suggest here but I am getting an error.
My codes are:
> samples <- c(eset1$characteristics, eset$characteristics)
> samples <- as.factor(samples)
>samples
>design <- model.matrix(~0 + samples)
>colnames(design) <- c( "TUMOR", "NORMAL")
>design
>levels(samples)
>library(limma)
>fit <- lmFit(filteredEset, design)
>contrast.matrix <- makeContrasts("TUMOR-NORMAL", levels = "samples")
Error: Error in eval(expr, envir, enclos) : object 'TUMOR' not found
A cursory inspection of the user's guide would reveal the correct call:
als not working
same error.
Are you sure you're running the code correctly? Here's an example that works on my machine: