This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Why I get error while performing DeSeq2 ?

While perfroming DEsEq2 analysis, I get the following error: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘NSBS’ for signature ‘"CompressedIntegerList"’

Also, I updated all the packages to latest ones inclusing bioconductor.

My code:

Load necessary packages

library(NOISeq)
library(edgeR)
library(DESeq2)
library(ggplot2)
library(reshape2)
library(gplots)
library(RColorBrewer)
library(limma)
library(sva)
library(biomaRt)
library(Rsamtools)

Load Phenotype and count data

rawCountTable <- as.matrix(read.delim(file.choose(), row.names=1))
Col_data = read.table(file = "tLUSC_Phenotype.txt", header = T, sep = "\t")

Run DeSeq2

dds = DESeqDataSetFromMatrix(countData = rawCountTable, colData = Col_data, design = ~ Type)
dds = DESeq(dds)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]
dds = estimateSizeFactors(dds)
sizeFactors(dds)
vsd <- vst(dds)
vsd2 <- assay(vst(dds, blind=FALSE))
deseq2 rna-seq normalization

At which step does that come up?

I get this error at the step

vsd <- vst(dds)

Rest all works fine till

sizeFactors(dds)

1 answer

I cannot reproduce this. The estimateSizeFactors S4 method is able to accept and return a DESeqDataSet, so that is not the issue. You can try DESeq2::vst(), maybe there is something in your namespace that is preferred over the DESeq2 method. Also restart R and try again. Please provide a reproducible example and the sessionInfo.

Thank you for your assistance and prompt reply sir.

I re-ran the code with following modifications and it works perfectly well. Please tell if my revised code is correct ?

Load necessary packages

library(DESeq2)
library(Rsamtools)
<h5>Load Phenotype and count data</h5>
rawCountTable <- as.matrix(read.delim(file.choose(), row.names=1))
Col_data = read.table(file = "LUSC_Phenotype.txt", header = T, sep = "\t")
<h5>Run DeSeq2</h5>
dds = DESeqDataSetFromMatrix(countData = rawCountTable, colData = Col_data, design = ~ Type)
dds = DESeq(dds)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]
dds = estimateSizeFactors(dds)
sizeFactors(dds)
vsd <- assay(varianceStabilizingTransformation(dds, blind=FALSE))

My original files are available at this link:

Phenotype file: https://od.lk/d/ODdfMjgyMjA5MTFf/LUSC_Phenotype.txt

Counts file: https://od.lk/d/ODdfMjgyMjA5MTBf/LUSC_COUNTS.txt

No one wants to follow an unknown link to download files from a stranger. You could start by showing us the summary of dds. Also, the DESeq function calls estimateSizeFunction as well as the rest of the DESeq commands (estimating dispersion, etc), so you don't have to do DESeq and estimateSizeFactors separately at that point. You should remove the low-count genes, then call DESeq, and then you don't have to do estimateSizeFactors again.

Log in to answer this question.