DeSeq2 Comparing One group vs Two groups
1
1
Entering edit mode
jkanbar ▴ 10
@jkanbar-20968
Last seen 3.1 years ago
United States

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))
DESeq2 • 2.0k views
ADD COMMENT
4
Entering edit mode
@mikelove
Last seen 5 days ago
United States

If you have a design of ~0 + condition this will help. That is the type of design you appear to be forming numeric contrasts for, as opposed to the reference-level-based design ~condition.

ADD COMMENT
0
Entering edit mode

This did help, many thanks!

ADD REPLY

Login before adding your answer.

Traffic: 386 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6