Question: DEseq three-group comparison
gravatar for duvaller
2.1 years ago by
duvaller30 wrote:

I would like to look at the differential expression of three groups- all with the same condition. Most resources I found focus on two-group comparison or two condition and two group comparison. I have not found anything for one condition and three group comparisons.

For example, I want to know what genes differ among three types of cells- type A, type B, and type C. I found suggestions to set up three separate pairwise comparisons (A/B, A/C, B/C), but would like to set up one three-group comparison (A/B/C) to determine which genes are unique to each cell type.

I have looked into using the contrast argument of the results function to extract comparisons, but get the error “(Type A) should be the name of a factor in the colData of the DESeqDataSet.”

dds <- DESeqDataSetFromMatrix(counts, DataFrame(groups), ~groups)
dds <- DESeq(dds)
res <- results(dds, contrast = c("Type A", "Type B", "Type C"))

Any advice is appreciated!

ADD COMMENTlink modified 17 months ago by sdbaney0 • written 2.1 years ago by duvaller30
res <- results(dds, contrast = c("Type A", "Type B", "Type C"))

I think this is not the proper way to use the contrast argument. If I understand correct what you need is, the genes specific to one type compared to the average of 2 other types. If so, following should work

type_A_result = results(dds, contrast = c(1, -1/2, -1/2))

type_B_result = results(dds, contrast = c(-1/2, 1, -1/2))

type_C_result = results(dds, contrast = c(-1/2, -1/2, 1))
ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by venu6.6k

Another kind of clunky way to do it would be to make more groups, one being "A" and "notA", the next group being "B" or "notB", etc.

ADD REPLYlink written 2.1 years ago by swbarnes27.9k

According to your error, I thought your colData input (DataFrame(groups) in your case) is not understandable for the function. So, the groups should be determined with factor function, and converted to the database which has the row.names are the names you wrote in contrast. I think you can create the different scenarios such as one condition and three comparisons with this way, I think.

condition <- factor(c(rep("Type A", 2), rep("Type B", 2), rep("Type C", 2))) 
coldata <- data.frame(row.names=colnames(countdata), condition)

And after DESeq function, results function should work when you type inputs like this (those codes will be different for your scenario for sure):

res <- results(dds, contrast = c("condition","Type A","Type B"))
ADD REPLYlink written 23 months ago by Batu170
gravatar for Kevin Blighe
22 months ago by
Kevin Blighe61k
University College London
Kevin Blighe61k wrote:

Has nobody yet mentioned performing a simple Likelihood Ratio Test (LRT), i.e., ANOVA?

ADD COMMENTlink written 22 months ago by Kevin Blighe61k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1592 users visited in the last hour