This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to use limma to find differentially expressed genes in response to a continuous variable

So I have 250 samples, and each of the samples has a "score" which is a continuous distribution of floating point numbers. I have followed the typical limma-voom workflow (https://ucdavis-bioinformatics-training.github.io/2018-June-RNA-Seq-Workshop/thursday/DE.html) up to the point where it is time to fit the linear model and make contrasts.

My model matrix is

mm <- model.matrix(~score + subtype)

Where subtype is a covariate because we assume cell subtype is a confounding variable. Anyway, I fit the linear model with

fit <- lmFit(y, mm)

Now I want to test to see which genes are correlated with the score variable. However, I am not sure how to make a contrast for this, since I am not contrasting two different variables and am instead measuring gene expression against a continuous variable. Does anyone have any insights here please?

limma voom r

1 answer

There's no need for form a contrast because the score variable is already in the model. A continuous variable is its own contrast. Just run the usual limma pipeline and test for score:

fit <- eBayes(fit)
topTable(fit, coef="score")

Log in to answer this question.