This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help with DESeq2 Analysis of Multiple Conditions

Hi all,

I want to do DE analysis using DESeq2. My experiment is Bulk RNA seq experiment with 1 cell line. I want to find out the DE genes between four conditions: Normal gravity (1G), Microgravity (MG), Stim and Unstim. Important to note is that this has an n=3.

I have following matrix (as an example)

gene    MGUnstim11    MGStim1    1GStim1    ...
gene1   233           91         17              
gene2   1011          0          7                
gene3   963           2          3

My aim is to find DE gene between the multiple conditions and be able to compare 1GStim vs MGStim and 1GUnstim vs. 1GStim and etc... All I can find on using DESeq is experiments with one condition, rather than 4.

This is what I have so far:

count_matrix <- read.table("Path/to/file.txt",
    header = TRUE,
    row.names = 1,
    sep = "\t"
    )

colData <- read.csv("path/to/file.csv",
    row.names = 1
)

#To make sure all the column names in colData match count_data: 
all(colnames(count_data) %in% rownames(colData))

#and are they in the same order?
all(colnames(count_data) == rownames(colData))

#make a count table with only the counts, remove all other data:
count_data <- count_matrix[, -(1;5)]

#add new combined variable to colData so that we can use the simpler approach to generating tables
#found in bioconductor INTERACTIONS chapter
colData$treatment <- factor(paste0(colData$Gravity, colData$Stimulation))

#creating a basic DESeqDataSet object with design set to new combined variable in colData:
dds <- DESeqDataSetFromMatrix(countData = as.data.frame(count_data),
colData = colData,
design = ~ treatment)

#prefiltering, removing rows with low gene counts (>=10)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]

#Relevel; tell DESeq to compare against 1GUnstim (1G and Unstim are the controls) as reference level and save as new object:
dds$treatment <- relevel(dds$treatment, ref = "1GUnstim")

#Running DESeq
dds <- DESeq(dds)


#save the results
Results <- results(dds)

res <- results(dds)
res

enter image description here

Here, it shows just treatment MGUnstim vs 1GUnstim... is this just what it's choosing to show me and I can pull more comparisons or what... I'm new to this so it may be a stupid question. Thanks!

deseq2

1 answer

Use contrasts in your results command to say what subgroup to compare to what.

Log in to answer this question.