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
condition
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
library(DESeq2)
directory<-'D:/test_deseq/tempora'
sampleFiles<-grep('Day',list.files(directory),value=TRUE)
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'))
colData(ddsHTSeq)
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
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?
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?
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?