I have a RNAseq data for repeated measures cross-over design. See below for the study design.
ID Group Time
1 SLEEP BASE
1 SLEEP POST
1 CON BASE
1 CON POST
2 SLEEP BASE
2 SLEEP POST
2 CON BASE
2 CON POST
Therefore, there is a dependence between measurements in the sleep group timepoints (BASE v POST) (repeated measures) but also dependence between the measurements between the groups (SLEEP v CON) as they the same participants (cross-over). I have done alot of reading and believe dream (within the variancePartition package) is the way to go.
I have followed the pipeline for edgeR-Limma https://www.bioconductor.org/packages/devel/workflows/vignettes/RNAseq123/inst/doc/limmaWorkflow.html e.g. filtered lowly expressed genes, normalised gene distributions (Calc Norm Factors with method="TMM") Then proceeded to the dream vignette https://www.bioconductor.org/packages/devel/bioc/vignettes/variancePartition/inst/doc/dream.html where I need to design the model.matrix. My questions are: 1) Transcriptome changes within SLEEP group (Sleep BASE v Sleep POST) 2) Transcriptome changes within CON group (CON BASE v CON POST) 3) Interaction: differences in the response of the transcriptome between sleep and CON.
This is where I would appreciate some guidance as to most appropriate way to code the random effect and more specifically how to code the ID.
Question 1) Can you run a crossover random effect in dream?
form <- ~ Group*Time + (1+Group|ID)
#Estimate weights using LMM of dream
vobjDream = voomWithDreamWeights(x, form, ss)
`
OR would a more simple random effect be more appropriate to account for the dependence between the 2 measurements within each group (SLEEP v CON)
form <- ~ Group*Time + (1|ID)
My second Question is regarding the coding of the ID, should it be individual for each timepoint for example:
1_SLEEP_B
1_SLEEP_P
1_CON_B
1_CON_P
2_SLEEP_B
2_SLEEP_P
2_CON_B
2_CON_P
or should it be coded so that the model recognises the paired measurements at baseline and post in each group
1_SLEEP
1_SLEEP
1_CON
1_CON
If this has already been answered please let me know the post so I can check it out.
Can I confirm that your study has only two participants and 8 samples in total?
Gordon Smyth Apologies for the confusion I was just providing a small snippet of the study in total I have 10 participants and 40 samples.