I've been trying to test if there are differentially expressed genes between different time-points of samples taken from the same donors.
SampleID Donor TimePoint
A1 1 T1
A2 1 T2
A3 1 T3
A4 2 T1
A5 2 T2
A6 2 T3
And so it goes until sampleID A12, so in total I have 4 different Donors and for each I have 3 timepoints.
I used a design that takes into account Donor (given that the samples from the same donor are not independent) and TimePoint:
~ Donor + TimePoint. I then used
test="LRT" when calling DESeq function with a reduced design:
~Donor to find genes which are different at any time-point. After that I tried to test individual effects by specifying a contrast in the results function:
Res <- results(DDS, contrast=c("TimePoint","T1","T2"))
But it give me an error:
Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues, : as T2 is the reference level, was expecting TimePoint_T1_vs_T2 to be present in 'resultsNames(object)'
I also tried:
Res <- results(DDS, contrast=c("TimePoint","T1","T2"), test="Wald")
And it gave me the same error. What am I doing wrong? Should I do this differently?
From just running results without contrast:
Res <- results(DDS) I get no errors and the results look as follows:
log2 fold change (MLE): TimePoint2 LRT p-value: '~ Mother_Child + TimePoint' vs '~ Mother_Child' DataFrame with 460 rows and 6 columns baseMean log2FoldChange lfcSE stat pvalue padj <numeric> <numeric> <numeric> <numeric> <numeric> <numeric> Otu402 2.279747 0.3111686 0.8422597 0.1381527 0.9332554 0.043 Otu131 22.551497 2.0865825 0.8764297 3.3208392 0.1900592 0.032
Why does it say "TimePoint2"? I thought it was the result of comparing T1 vs T2, because is using as reference TimePoint T1, but when I try relevel to set T2 as reference, the results are exactly the same :(
Please, any help would be greatly appreciated :)