Question: intra-sample time series comparison using DESeq2
0
gravatar for prppmet
2.4 years ago by
prppmet0
United States
prppmet0 wrote:

I need help with Time series testing using DESeq2. - I have 5 subjects given same treatment at 11 different time points (for each subject: single observation at 1 day interval from 0d through 10d).

I). the sampledata table looks like (tab-delimited):

subject time (d)

A D0 ... A D10

B D0 ... B D10

C D0 ... C D10

D D0 ... D D10

E D0 ... E D10

II). The objective is to compare each time point with 0d (baseline reference) within each subject, separately: for example, D_D10 vs D_D0 (not the default baseline A_D0). I tried to set A, B, C, D & E by turn as baseline subjects and D0 as baseline time and use the contrast shown below in an example for subject D.

  • set relevel for subject

sampledata$subject <- relevel(sampledata$subject, ref = "D");

  • set relevel for time factor (default anyway)

sampledata$time <- relevel(sampledata$time, ref = "D0");

  • create DESeq data object & define model design

ddsD <- DESeqDataSetFromMatrix(countData = countsdata, colData = sampledata, design = ~ subject + time);

  • LRT test with reduced model

ddsD <- DESeq(ddsD, test="LRT", reduced = ~subject); #or ~time (get the same comparison terms)

  • resultsNames

    resultsNames(ddsD) [1] "Intercept" "subject_A_vs_D" "subject_B_vs_D" [4] "subject_C_vs_D" "subject_E_vs_D" "time_D1_vs_D0"
    [7] "time_D2_vs_D0" "time_D3_vs_D0" "time_D4_vs_D0"
    [10] "time_D5_vs_D0" "time_D6_vs_D0" "time_D7_vs_D0"
    [13] "time_D8_vs_D0" "time_D9_vs_D0" "time_D10_vs_D0"

  • ignore subject effect terms & use only (baseline) time point comparison terms as below results(ddsD, name= "time_D10_vs_D0", test="Wald");

Will this work for my objective? I am not sure which 'D0' is being used here (is it from subject A or D?). If this is wrong, how should I proceed with the test? Thanks.

ADD COMMENTlink modified 2.4 years ago by Biostar ♦♦ 20 • written 2.4 years ago by prppmet0

Hello prppmet!

It appears that your post has been cross-posted to another site: https://support.bioconductor.org/p/93890/

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLYlink written 2.4 years ago by WouterDeCoster40k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 858 users visited in the last hour