How to get DEGs compare one sample to another?
0
0
Entering edit mode
2.5 years ago
Simon Ahn ▴ 10

enter image description here

I have a count matrix data (23 samples with different condition), and coldata is shown above. I want to get DEGS like this:

enter image description here

I tried this code:

# Read data
data_matrix <- read.csv("matrix_data", row.names=1)
coldata <- read.csv("data/coldata.csv", row.names=1)

# Creating DESeq object
dds <- DESeqDataSetFromMatrix(countData = data_matrix,
                              colData = coldata,
                              design = ~ condition)

# Pre-filtering low count cells
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]

# specifying the reference level
dds$condition <- relevel(dds$condition, ref = "control")

# Run DEseq
dds <- DESeq(dds)
resultsNames(dds)

However, I cannot find the data result when I used resultsNames(dds). Which code should I use to get what I want?

DESeq2 DEG • 972 views
ADD COMMENT
0
Entering edit mode

in the first step, what do you get if you typed head(data_matrix)?

ADD REPLY
0
Entering edit mode

enter image description here

something like this (Not all samples are shown)

ADD REPLY
0
Entering edit mode

You first state that you'd like to obtain DEGs by ~time, but then use ~condition for the comparison. Which one is it? And do you really only have one single sample for time point 0?

What happens for resultsNames(dds)? Is it a truly empty object, do you get an error message, or else?

ADD REPLY
0
Entering edit mode

Try this way:

#Run DEseq

dds <- DESeq(dds)
design(dds) <- formula(~ control)
resultsNames(dds)

Let me know if now you get the desired comparisons available when running resultsNames(dds).

ADD REPLY

Login before adding your answer.

Traffic: 2127 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