DESeq2 in R
Entering edit mode
amoaristotle ▴ 10
Last seen 7 months ago

I ran the following code correctly:

#just.raw.counts was my countData and is my colData

>just.raw.counts = read.delim("Raw_counts_input.txt")
>just.raw.counts = read.delim("Raw_counts_input.txt", row.names=1)
>just.raw.counts <- as.matrix(just.raw.counts)
> = read.delim(file="meta_data.txt", row.names = 1)
> <- DESeqDataSetFromMatrix(countData=just.raw.counts, 
                               , design= ~ condition) 
> <- DESeq(

I had no issues to this point

Then I want to apply the apeglm shrinkage but first I ran this code below


and it gave me the coef below

[1] "Intercept"                 "condition_Day1_vs_Control" "condition_Day2_vs_Control" "condition_Day3_vs_Control"
[5] "condition_Day5_vs_Control"

Afterwards I ran the following code to perform the apeglm shrinkage: <- lfcShrink(, coef=5, type="apeglm")

At this point there was not problem

Then I ran another code to show the result

res <- results(, contrast=c("condition","Day1","Control"))

At this point, I got an error which is

Error in results(, contrast = c("condition", "Day1",  : 
  is(object, "DESeqDataSet") is not TRUE

AT this point am dumbfounded and I don't know what to do.

Please help me

DESeq2 apeglm • 295 views
Entering edit mode
swbarnes2 ▴ 850
Last seen 7 hours ago
San Diego

It's exactly what the error says. is not a DESeq object. It's a DESeqResults object.

Entering edit mode
Last seen 3 hours ago
Republic of Ireland

Apologies to ask, but, did you check how this is done in the vignette? - see

You just seem to be running 2 commands in the incorrect order and have variables / coefficients in the incorrect place.

You could try something like:

just.raw.counts = read.delim("Raw_counts_input.txt")
just.raw.counts <- as.matrix(just.raw.counts) = read.delim(file="meta_data.txt", row.names = 1) <- DESeqDataSetFromMatrix(
  design= ~ condition) <- DESeq(

# Day 5 versus control
res <- results(, name = 'condition_Day5_vs_Control')
res <- lfcShrink(, coef = 'condition_Day5_vs_Control', type = 'apeglm')

For other type of comparisons involving coefficients not listed by resultsNames(), take a look here:



Login before adding your answer.

Traffic: 197 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6