I tried to fit a linear model on a set of metabolomics data for an experiment: drug treatment for a group of animals to receive 7 different types of concentration. Each group of animals there are 10 replicates. I would like to plot the changes of a particular metabolites across different concentration of drug given. It is like a factorial design here.
Everything works well until it comes to the end when I wanted to get the logFC which represents the gradient of the overall changes.
grp=factor(target$Group, levels=c("0","0.1","10","30","50","80","100"))
design <- model.matrix(~grp)
fit <- lmFit(data, design)
topTable(fit, n = Inf, adjust="BH")
The output gave me a list of coefficients which corresponds to each level of the design , a column of AveExpr, F, P.value and adj.Pval. I wonder if anyone can kindly suggest me a way to get the logFC? either calculate manually or is there any changes on the code that I have missed out? I saw many posts mentioned that limma is treating each time point independently in a time series experiment. I am not interested in contrast and treating each group of treatment separately. I wonder if is there a way for me to calculate the logFC in this case.
The set up of the experiment is somehow similar to the post below, but in a simpler way Microarray Time series data analysis through limma ?
As I am just interested to see how weill it fits into a linear trend, I will need the the logFC which in this case I would like to treat it as a slope. Do you know how to do it? I think it should be easy too but I cannot figure it out yet( maybe not so easy then)
It works exactly the same, you simply have to make sure that
grp
is a numeric vector instead of a factor:etc
I can see the changes has made the multi-level design turned into just control vs condition , a simple linear model. Instead of comparing each group vs control, it compares between the samples vs control, Thank you very much!