Entering edit mode
7.1 years ago
Lila M
★
1.3k
Hie everybody,
I have this error when I've tried to run dsd = testForDEU(dsd)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘sizeFactors’ for signature ‘"list"’
My complete code is:
meta <- read.delim(file.path("meta"), header=T)
rownames(meta) <- meta$sample_ID
countfiles <- list.files(pattern = "*.txt", full.names = TRUE)
names(countfiles) <- gsub(".txt", "", basename(countfiles))
flattenedFile = list.files(pattern="gff$", full.names=TRUE)
basename(flattenedFile)
dsd <- DEXSeqDataSetFromHTSeq(countfiles = countfiles, sampleData = meta,
design = ~ sample + exon + levels:exon, flattenedfile = flattenedFile)
genesForSubset <- unique(geneIDs(dsd))
dsd <- dsd[geneIDs(dsd) %in% genesForSubset,]
colData(dsd)
dsd = estimateDispersions(dsd)
dsd = estimateSizeFactors( dsd )
dsd = plotDispEsts(dsd)
dsd = testForDEU(dsd)
The flattened file was created using
python dexseq_prepare_annotation.py gencode.v27.annotation.gtf annot.hg38.DEXSeq.gff
and the counts:
ls *.bam.sam | xargs -I {} -n 1 python dexseq_count.py -p yes -s reverse -r pos annot.hg38.DEXSeq.gff {} {}.txt
Any suggestion or idea to solve my problem?
Thanks!
Check
str(dsd)
after callingDEXSeqDataSetFromHTSeq
, and again when subsetting. I suspect you've somehow made that object into a list rather than a DESeq2 object.I think you forgot to call
dsd = estimateSizeFactors( dsd )
I forgot to include it in the code, but I've called it as well, thanks!
Did you call it in that order? Or to be more precise: after which call did the error message apear?
Yes, I called it in that order, and the error appear after dsd = testForDEU(dsd)
AFAIK, you need to estimate the SizeFactors before estimating the dispersion.