DESeq2 in R
Entering edit mode
amoaristotle • 10
Last seen 23 days 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 • 127 views
Entering edit mode
swbarnes2 • 650
Last seen 35 minutes ago

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

Entering edit mode
Last seen 1 hour 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.

Similar Posts
Loading Similar Posts
Traffic: 222 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.4