Hi everyone,
I am using DESeq2
(v1.26.0) to find DEGs between group1
and group2
, and also betweengroup2
and group3
, respectly. And there are ten replicate samples in each group. In the result, there is a gene ABC which is up-regulated in group2, and down-regulated in group3. When I check the raw reads count matrix, I found that one sample in group2 expressed 133 reads, and the remaining 29 samples expressed no reads, so it is "up" than group1 and group3 is "down" than group2.
Does everyone have encountered this problem, is this result reasonable?
And another question:
All 30 samples are from 4 individuals, and PCA analysis shows that the differences between individuals are greater than groups. So I treat individuals as different batches, and constructing dds: design =~ batch + condition
. The result looks ok, but I'm not sure. -_-|| What do you think?
Thank you very much for any suggestions! I'm new in this field, and any replies will be helpful for me.
Here is my code:
colData <- read.table('group.txt', header=TRUE, row.names=1)
readscount <- read.table('readscount.txt', header=TRUE, row.names=1)
condition <- factor(c(rep("group1",10),rep("group2",10)))
batch <- factor(c(rep("idv1",3),"idv2",rep("idv3",3),rep("idv4",3),
rep("idv1",3),"idv2",rep("idv3",4),rep("idv4",3)))
library(DESeq2)
dds <- DESeqDataSetFromMatrix(readscount, colData, design =~ batch + condition)
dds <- dds[ rowSums(counts(dds)) > 1, ]
dds_norm <- DESeq(dds)
res <- results(dds_norm, contrast = c("condition","group2","group1"))
data <- merge(as.data.frame(res),as.data.frame(counts(dds_norm,normalize=TRUE)),by="row.names",sort=FALSE)
res_data <- data.frame(data)
up_DEG <- subset(res_data, padj < 0.05 & log2FoldChange > 1)
down_DEG <- subset(res_data, padj < 0.05 & log2FoldChange < -1)
Thanks! And I read the vignette, it really helped me, thanks again.