3.5 Creating the DESeqDataSet

The DESeqDataSet (DDS) is DESeq2’s core data container. It holds the raw count matrix, sample metadata, and the experimental design formula. The design formula tells DESeq2 which variable to test — here ~ condition compares treatment vs control.

📘 Note: Prokaryote: DESeq2’s negative binomial model is organism-agnostic. It works identically for E. coli as for mouse or human data. ✅

samples_info$condition <- factor(samples_info$group,
                                 levels = c("control", "treatment"))

dds <- DESeqDataSetFromMatrix(
  countData = count_genes,
  colData   = samples_info,
  design    = ~ condition
)