Hello thank you so much, I was a little lost. So here is what I did once i got my counts matrix as cts. I dont know if the results I got are correct: I wanted to do many comparisons, I have 3 samples for each of 5 conditions:
sampleTable<-data.frame(row.names=c("Bm14a","Bm14b","Bm14c","BTY14a","BTY14b","BTY14c","Mm14a","Mm14b","Mm14c","MTY14a","MTY14b","MTY14c","N14a","N14b","N14c"), condition=as.factor(c(rep("Bm14",3), rep("BTY14", 3), rep("Mm14", 3), rep("MTY14", 3),rep("N14", 3))))
dds <- DESeqDataSetFromMatrix(countData = cts,colData = sampleTable,design = ~ condition)
Pre-filtering:
dds <- dds[ rowSums(counts(dds)) > 1, ]
dds <- DESeq(dds)
All my comparisons:
Comp_1<-results(dds, contrast=c("condition","N14","Bm14"))
Comp_2<-results(dds, contrast=c("condition","N14","BTY14"))
Comp_3<-results(dds, contrast=c("condition","N14","Mm14"))
and so on ...
Comp_7<-results(dds, contrast=c("condition","MTY14","Mm14"))
And to check the total differentially expressed genes for each comparison i did the following for each Comp_n:
Comp_1_resSig <- Comp_1[which(Comp_1$padj <0.1),]
head(Comp_1_resSig[order(Comp_1_resSig$log2FoldChange, decreasing = TRUE),])
nrow(Comp_1_resSig)
Is what I did correct? Are my results reliable? Are the p-values adjusted to each comparison? (I did not do a relevel because I read that for so many comparisons it wont make a difference)
Could you clarify your experimental design?
My guess would by that dpi is Days Post Infection, and you you have 3 biological replicates for each condition (infected with bacteria,naive...) at different times (2 days,7 days...) , if this is okay, the experimental design is crucial for creating a DEseq object ,could you update the question with a more clear explanation of the design so that we can help you
Hello, yes il explain better:
Samples were taken at 2, 7, 14 and 21 days post infection. There are 5 conditions , and 3 plants (or biological replicates) for each condition.
I decided to do a diferential expression analysis for each dpi independently with DESeq2, and I did the following :
sampleTable< -data.frame(row.names=c("Bm14a","Bm14b","Bm14c","BTY14a","BTY14b","BTY14c","Mm14a","Mm14b","Mm14c","MTY14a","MTY14b","MTY14c","N14a","N14b","N14c"), condition=as.factor(c(rep("Bm14",3), rep("BTY14", 3), rep("Mm14", 3), rep("MTY14", 3),rep("N14", 3))))
dds <- DESeqDataSetFromMatrix(countData = cts,colData = sampleTable,design = ~ condition)
Then, for every comparison (there are 7) I did this:
Comp_1<-results(dds, contrast=c("condition","N14","Bm14"))
...
And to count total diferentially expressed genes for each comparison I did:
Comp_1_resSig <- Comp_1[which(Comp_1$padj <0.1),]
head(Comp_1_resSig[order(Comp_1_resSig$log2FoldChange, decreasing = TRUE),])
nrow(Comp_1_resSig)
Does this make sense? Or did I do something wrong?