Question: edgeR for time series
0
9 months ago by
United States
sharvari gujja20 wrote:

Hi,

I am writing to clarify on the design matrix for running edgeR on data with multiple time points with two conditions.

       condition time Group


sample1 condition1 T0 c1.to sample2 condition2 T0 c2.t0 sample3 condition1 T1 c1.t1 sample4 condition2 T1 c2.t1 sample5 condition1 T2 c1.t2 sample6 condition2 T2 c2.t2

Following section 3,3 in the edgeR manual, to find differentially expressed genes between condition1 and condition2 at baseline, T0,T1 andT2, the contrasts used are for example:

my.contrasts <- makeContrasts(
c1.vs.c2.baseline = c1.t0-c2.t0,
c1.vs.c2.T1 = (c1.t1-c1.t0)-(c2.t1-c2.t0),
c1.vs.c2.T2 = (c1.t2-c1.t0)-(c2.t2-c2.t0),
levels=design
)

lrt0<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.baseline"])
lrt1<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.T1"])
lrt2<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.T2"])


Can you please let me know if I should be using any different approach for the comparisons.

Thanks for all the help. Sharvari

edger • 341 views
modified 9 months ago by Gordon Smyth38k • written 9 months ago by sharvari gujja20

First, if the edgeR User's Guide already tells you what to do, what is your question? Why would the advice of the User's Manual not be correct?

Second, we can't tell what your experiment design is or how you have created your design matrix, so we don't have any way to give you advice. It looks like the 3 lines of your question after the first sentence have become garbled by markdown. I can't make sense of them. What did you want to tell us?

My question was to get your feedback about the approach I am using for this multiple time point data analysis, as I have not analyzed time series data before. Or, if you recommend using ANOVA-like test instead.

Sorry about the garbled text. The conditions at different time points are:

sample condition time Group
sample1 condition1 T0 c1.t0
sample2 condition2 T0 c2.t0
sample3 condition1 T1 c1.t1
sample4 condition2 T1 c2.t1
sample5 condition1 T2 c1.t2
sample6 condition2 T2 c2.t2


Thank you for helping.

You still haven't said what your design matrix is -- I am assuming it is design <- model.matrix(~0+Group).

Your experiment doesn't have any replication (6 treatment groups and 6 samples). How were you planning to estimate the dispersion without replicates?

You do have to make your own decisions about which experimental groups you want to compare. It is your experiment after all.

Dear Gordan, Thank you for the reply, The data is single cell RNAseq data where condition1 is genotype1 and condition2 is genotype2 for three time points.

The data is processed for edgeR analysis using the workflow mentioned in the link below: https://bioconductor.org/packages/release/bioc/vignettes/zinbwave/inst/doc/intro.html#differential-expression-with-edger

Yes,that's the design matrix. To perform ANOVA like testing to find differences between genotype1 and genotype2 across three timepoints, I am creating contrast matrix as:

design <- model.matrix(~0+Group)

con <- makeContrasts(
genotype1.vs.genotype2.T0 = genotype1_T0-genotype2_T0,
genotype1.vs.genotype2.T1 = (genotype1_T1-genotype1_T0)-(genotype2_T1-genotype2_T0),
genotype1.vs.genotype2.T2 = (genotype1_T2-genotype1_T0)-(genotype2_T2-genotype2_T0),
levels=design)

anov <- glmWeightedF(fit, contrast=con)


My questions are: 1. Is the contrast matrix correct to find differences across time points between two genotypes? 2. What kind of post hoc test would you recommend to follow up one-way ANOVA analysis?

1
9 months ago by
Gordon Smyth38k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth38k wrote:

1. Is the contrast matrix correct to find differences across time points between two genotypes?

Your first contrast measures the baseline (T0) difference between genotypes 1 and 2. Your second contrast is the T1 x genotype interaction. Your third contrast in the T2 x genotype interaction. If that's what you wanted, then the contrasts are correct.

2. What kind of post hoc test would you recommend to follow up one-way ANOVA analysis?

edgeR adjusts for multiple testing automatically. You don't need to do anything extra yourself.