DESeq2 multiple conditions, time points and sample types
1
0
Entering edit mode
12 months ago
DHARMESH • 0

I am working with the raw count data, and the metadata consists of three groups, A, B, and C. Each group has four-time points, 3h, 6h, 12h, and 18h, and two treatment and control conditions.

What I want is quite simple; I want to measure control vs. treatment from one group or within the group. For example, In A, there are two replicates for control and treatment for each time. I want to compare control vs. treatment to get an overall differential expression of genes across all time points in A only.

I hope I made it understandable. How do I design the DESeqDataSet?

enter image description here

DEseq2 R edgeR • 1.4k views
ADD COMMENT
1
Entering edit mode

Can you provide a table with sample information, group, replicate and time point ?

ADD REPLY
1
Entering edit mode

You can create a new column where it's a combination of Group and Condition. For example, new column Class which will contains row as controlA, controlA, TreatedA, .... controlC. Then it's easy to make ddsobject

ADD REPLY
2
Entering edit mode
12 months ago
DareDevil ★ 4.3k

You can create a new column where it's a combination of Group and Condition. For example, new column Class which will contains row as controlA, controlA, TreatedA, ...., controlC. Then it's easy to make dds object

#read the expression data in raw counts
readcounts <- read.table("expression_raw_counts.txt", header=TRUE, row.names = 1)

#read the sample information
sample_info <- read.table('sample_information.txt', sep='\t', header = TRUE, row.names = 1)

#Create a DESeq2 object named dds from the gene read count and sample information
dds <- DESeqDataSetFromMatrix(countData = readcounts,
                              colData = sample_info,
                              design = ~ Class)

#remove genes with 0 counts
keep_genes <- rowSums(counts(dds)) > 0
dds <- dds[ keep_genes, ]

#run deseq2
dds <- DESeq(dds, betaPrior=FALSE)

#generate results
res = results(dds, contrast = c("Class", "TreatedA", "controlA"))
write.table(res, "TreatedA_controlA.txt", sep='\t')

#run lfcShrink
res = lfcShrink(dds, contrast = c("Class", "TreatedA", "controlA"), res=res)
write.table(res, "TreatedA_controlA.lfc.txt", sep='\t')
ADD COMMENT
0
Entering edit mode

I did this the same earlier, but is it the right way to do it?

ADD REPLY
1
Entering edit mode

If you are not looking at time points, there is no error in the flow

ADD REPLY
0
Entering edit mode

I would add time to the design, so the algorithm knows that that is a variable that should added to the model. But the rest can stay the same.

ADD REPLY

Login before adding your answer.

Traffic: 1600 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6