Deleted:DESeq2 design with 6 groups
1
0
Entering edit mode
teddy1 • 0
@ccc03770
Last seen 4 weeks ago
Somewhere

I have data composed of 3 different controls and 3 different treatments each in triplicates. The data is represented below for easier understanding:

sample         condition     condition_by_groups
controlA_1     untreated     untreated_A
controlA_2     untreated     untreated_A
controlA_3     untreated     untreated_A
controlB_1     untreated     untreated_B
controlB_2     untreated     untreated_B
controlB_3     untreated     untreated_B
controlC_1     untreated     untreated_C
controlC_2     untreated     untreated_C
controlC_3     untreated     untreated_C

treatedA_1     treated       treated_A
treatedA_2     treated       treated_A
treatedA_3     treated       treated_A
treatedB_1     treated       treated_B
treatedB_2     treated       treated_B
treatedB_3     treated       treated_B
treatedC_1     treated       treated_C
treatedC_2     treated       treated_C
treatedC_3     treated       treated_C

A, B, C represents the different controls or treatments and the numbers 1, 2 and 3 the biological repeats.

I would like to analyze the difference in gene expression in the following way:

  1. treated vs untreated (disregarding the fact that controls and treatments are different)
  2. pairwise by groups (e.g. treated_A vs untreated_A; treated_B vs untreated_B, etc.)

I have setup the design like this:

coldata <- data.frame(
   sample = c( "controlA_1", "controlA_2", "controlA_3", "controlB_1", "controlB_2", "controlB_3", "controlC_1", "controlC_2", "controlC_3", 
                "treatedA_1", "treatedA_2", "treatedA_3", "treatedB_1", "treatedB_2", "treatedB_3", "treatedC_1", "treatedC_2", "treatedC_3" ),

   condition = c( "untreated", "untreated", "untreated", "untreated", "untreated", "untreated", "untreated", "untreated", "untreated",
                    "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated", "treated" ), 

   condition_by_groups = c( "untreated_A", "untreated_A", "untreated_A", "untreated_B", "untreated_B", "untreated_A", "untreated_C", "untreated_C", "untreated_C",
                                "treated_A", "treated_A", "treated_A", "treated_B", "treated_B", "treated_B", "treated_C", "treated_C", "treated_C" ), 
  row.names = "sample" )

coldata$condition <- as.factor(coldata$condition)
coldata$condition_by_groups <- as.factor(coldata$condition_by_groups)

#construct DESeqDataSet1
dds <- DESeqDataSetFromMatrix(countData = count_matrix, colData = coldata, 
                              design = ~ condition)

dds <- DESeq(dds)

res0 <- results(dds, contrast=c("condition", "treated", "untreated"))

#construct DESeqDataSet2
dds <- DESeqDataSetFromMatrix(countData = count_matrix, colData = coldata, 
                              design = ~ condition_by_groups)

dds <- DESeq(dds)

res1 <- results(dds, contrast = c('condition_by_groups', 'treated_A', 'untreated_A'))
res2 <- results(dds, contrast = c('condition_by_groups', 'treated_B', 'untreated_B'))
res3 <- results(dds, contrast = c('condition_by_groups', 'treated_C', 'untreated_C'))

Is it appropriate for the analyses I want to perform or something needs to be modified?

DESeq2 • 79 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 232 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