I ran the following code correctly:
#just.raw.counts was my countData and meta.data 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)
>meta.data = read.delim(file="meta_data.txt", row.names = 1)
>count.data.set <- DESeqDataSetFromMatrix(countData=just.raw.counts,
colData=meta.data, design= ~ condition)
>count.data.set.object <- DESeq(count.data.set)
I had no issues to this point
Then I want to apply the apeglm shrinkage but first I ran this code below
>resultsNames(count.data.set.object)
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:
count.data.set.object.2 <- lfcShrink(dds=count.data.set.object, coef=5, type="apeglm")
At this point there was not problem
Then I ran another code to show the result
res <- results(count.data.set.object.2, contrast=c("condition","Day1","Control"))
At this point, I got an error which is
Error in results(count.data.set.object.2, 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