I have a dataset with two factors: Stage and Form, 4 replicates associated with each combination of the factors:
Stage Form DS1_Wr60 Wr60 DS DS2_Wr60 Wr60 DS DS3_Wr60 Wr60 DS DS4_Wr60 Wr60 DS WS1_Wr60 Wr60 WS WS2_Wr60 Wr60 WS WS3_Wr60 Wr60 WS WS4_Wr60 Wr60 WS DS1_PP50 PP50 DS DS2_PP50 PP50 DS DS3_PP50 PP50 DS DS4_PP50 PP50 DS WS1_PP50 PP50 WS WS2_PP50 PP50 WS WS3_PP50 PP50 WS WS4_PP50 PP50 WS DS1_P15 P15 DS DS2_P15 P15 DS DS3_P15 P15 DS DS4_P15 P15 DS WS1_P15 P15 WS WS2_P15 P15 WS WS3_P15 P15 WS WS4_P15 P15 WS DS1_P50 P50 DS DS2_P50 P50 DS DS3_P50 P50 DS DS4_P50 P50 DS WS1_P50 P50 WS WS2_P50 P50 WS WS3_P50 P50 WS WS4_P50 P50 WS
The comparisons I hope to make are:
DE genes across all four stages
DE genes between a specified pair of stages
- DE genes between two forms of a specified stage
My first question is how do I create the initial dds that is possible to cover all these comparisons?
That is what I tried:
count_data = dataframe of count matrix of all samples Stage = list of Stages for all samples Form = list of Forms for all samples col_data <- data.frame(row.names = colnames(count_data),Stage,Form) dds <- DESeqDataSetFromMatrix(countData = count_data,colData = col_data,design = ~ Stage)
Based on my understanding, this will generate DE genes between different stages. And I can use 'contrast' to specify the result of DE genes of a specified pair of stages.
Then how I can get the list of DE among all four stages?
And what about the 'Form'? Do I also put it as 'design' as well?
I know that a more straightforward way is to selectively input the samples that I want to investigate and do multiple comparisons seperately. But is it possible to do it in the whole matrix?
Sorry I am totally lost how to design the dds and reading the help page of deseq2 does not help a lot. Hope someone could clarify this.