This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get DEGs compare one sample to another?

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

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

enter image description here

something like this (Not all samples are shown)

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?

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).

0 answers

No answers yet.

Log in to answer this question.