Question: DESeq2 compare all_vs_all levels error
gravatar for
4 months ago by
aishu.jp10 wrote:

I am currently working in plant pathogen interaction and is trying to make a gene co-expression network using RNA-seq data. I used HTseq-count to get the read counts.

My dataset consist of Resis_treated (1st day, 3rd day and 7th day) samples taken under 3 time point with 2 replicated for each time point. I have a factor with 3 levels


Day1 Day1 Day3 Day3 Day7 Day7

I am trying to get the DEGs between Day3VsDay1, Day7VsDay1 and Day7Vs_Day3. The code I used is as follows




sampleCondition<-c('Day1','Day1','Day3','Day3', 'Day7','Day7')

sampleTable<-data.frame(sampleName=sampleFiles, fileName=sampleFiles, condition=sampleCondition)

ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~condition)

colData(ddsHTSeq)$condition<-factor(colData(ddsHTSeq)$condition, levels=c('Day1','Day3','Day7'))


ddsHTSeq <- ddsHTSeq[ rowSums(counts(ddsHTSeq)) > 1, ] ddsHTSeq dds <- DESeq(ddsHTSeq) resultsNames(dds) [1] "Intercept" "conditionDay3vsDay1" "conditionDay7vsDay1"

After running the code, to get all of the pairwise comparisons I used lfcShrink() with the contrast= option 3 times.

I tried to contrast day7VsDay3 data. But it showed an error as follows

day73 <- lfcShrink(dds, contrast=c("condition", "day7", "day3")) Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues, : day7 and day3 should be levels of condition such that condition_day7_vs_Day1 and condition_day3_vs_Day1 are contained in 'resultsNames(object)'

Kindly help me to resolve the error.

Is there any error in defining levels in sampleCondition andcoldata line**

how do I get all pairwise combinations of all levels espiecially Day7vsDay3 along with the other two combinations

rnaseq deseq2 error • 157 views
ADD COMMENTlink modified 4 months ago by swbarnes2340 • written 4 months ago by aishu.jp10
Answer: DESeq2 compare all_vs_all levels error
gravatar for swbarnes2
4 months ago by
swbarnes2340 wrote:

Well, your resultsNames show that you have "conditionDay7vsDay1", not "conditionday7vsDay1"

So day73 <- lfcShrink(dds, contrast=c("condition", "Day7", "Day3"))

should work

ADD COMMENTlink modified 4 months ago • written 4 months ago by swbarnes2340

Thank you so much. It was typo trouble

After getting all the three combinations

`day73 <- lfcShrink(dds, contrast=c("condition", "day7", "day3"))

day71 <- lfcShrink(dds, contrast=c("condition", "day7", "day1"))

day31 <- lfcShrink(dds, contrast=c("condition", "day3", "day1"))`

In the result table of all the three combinations saved separately, It was observes that the base mean value was same for all of three combinations

And also the log2fc is very less in each combination when compared to the results of all the wald test done for each combination (Day3VsDay1, Day7VsDay1 and Day7Vs_Day3) individually as separate three DESeq run. Why is it so?

ADD REPLYlink written 4 months ago by aishu.jp10

Well, yes, the basemean is the same. Its using the basemean from all three days worth of samples.

And shouldn't you expect log fold changes to be, well, shrunken if you run 'lfcshrink' on them?

ADD REPLYlink written 4 months ago by swbarnes2340

But is it necessary to use lfcshrink in allvsall design comparison. Will it affect in identification of significant genes?

What affect lfcshrink () will have in the expression values of genes?

ADD REPLYlink written 4 months ago by aishu.jp10
Please log in to add an answer.


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