Hi All,
I have three conditions and two replicates per condition. I'd like to make three comparisons:
(1) TE vs [MP and EE] (2) MP vs [TE and EE] (3) EE vs [TE and MP]
I've tried doing the comparison below but output doesn't seem quite right.
Could someone point me how to correctly make these comparisons and where in my code below I might be making a mistake. Any help would be greatly appreciate, many thanks.
Code should be placed in three backticks as shown below
samples <- c('TE_1', 'TE_2',
'MP_1', 'MP_2',
'EE_1','EE_2')
replicates <- c('TE', 'TE',
'MP','MP',
'EE','EE')
col_data = matrix(replicates, # the data elements
nrow=6, # number of rows
ncol=1, # number of columns
byrow = TRUE)
colnames(col_data) <- c('condition')
rownames(col_data) <- samples
col_data <- as.data.frame(col_data)
dds <- DESeqDataSetFromMatrix(countData = counts,
colData = col_data,
design = ~ condition)
dds <- DESeq(dds)
TE_results <- results(dds, contrast = c(1, -1/2, -1/2))
MP_results <- results(dds, contrast = c(-1/2, 1, -1/2))
EE_results <- results(dds, contrast = c(-1/2, -1/2, 1))
This did help, many thanks!