Entering edit mode
Hi, I have the following RNA-Seq design (a subset):
Time Albumin Media Group
0h noAlbumin Host 0h.noAlbumin
0h withAlbumin Host 0h.withAlbumin
0h noAlbumin Plastic 0h.noAlbumin
0h withAlbumin Plastic 0h.withAlbumin
24h noAlbumin Host 24h.noAlbumin
24h withAlbumin Host 24h.withAlbumin
24h noAlbumin Plastic 24h.noAlbumin
24h withAlbumin Plastic 24h.withAlbumin
3h noAlbumin Host 3h.noAlbumin
3h withAlbumin Host 3h.withAlbumin
3h noAlbumin Plastic 3h.noAlbumin
3h withAlbumin Plastic 3h.withAlbumin
I run DESeq2 as below:
pre_dds <- DESeqDataSetFromMatrix(yeast, colData_DE, design = ~Media+Group+Media:Group)
dds <- DESeq(pre_dds)
At 24h, I want to get the effect of albumin on Plastic (the reference level), interaction term, and effect of albumin on Host.
The first two work:
results(dds, contrast = c("Group","24h.withAlbumin", "24h.noAlbumin"))
results(dds, name="MediaHost.Group24h_withAlbumin")
But the last one throws an error:
results(dds, list( c("Group_24h.withAlbumin_vs_24h.noAlbumin","MediaHost.Group24h.withAlbumin") ))
Error in checkContrast(contrast, resNames) :
all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'
I am wondering why is this happening and how can I specify that contrast in the results()?
hi Michael, many thanks for the swift reply!
My resultsNames(dds) look like:
The comparison I want is not there readily, but the contrast results(dds, contrast = c("Group","24h.withAlbumin", "24h.noAlbumin")) works. I tried different things, for example changing the "." to "_", changing the names of variable, etc, but so far nothing worked. Is there a different way to retrieve that contrast? I am on DESeq2_1.26.0
Thanks once again
Oh I see. Yes, you can't refer to a coefficient that doesn't exist.
You need to build up to the difference. So you have
Group_24h.withAlbumin_vs_0h.noAlbumin
as the albumin effect in reference, and then you need to add the interactionMediaHost.Group24h.withAlbumin
.sorry for a naive question (probably I am not following), isn't the Group_24h.withAlbumin_vs_0h.noAlbumin comparing 24h with albumin vs 0h without albumin? I need to get the effect of albumin at 24h.
I'm sorry, I don't have a lot of time to walk through interpretation of results -- for that I always recommend to consult a statistician or someone familiar with linear models in R. I make myself available here for software related issues.
Understood, thank anyway! Just the last clarification which will help me dig further: Do you mean that:
gets the effect of albumin at 24h on the Host?
cheers
That's 24 h albumin vs 0h no albumin in host. This is probably a case where you're better off not grouping time and albumin status. It would be easier to set up the design and contrasts with albumin treatment, time, and media as three variables.