Error function vst in DESeq2
2
0
Entering edit mode
6 weeks ago
Larissa • 0
dds <- DESeqDataSetFromMatrix (countData = countdata,
                               colData = metadata,
                               design = ~ Condition + Genotype)
dds <- estimateSizeFactors(dds)
vst_data <- vst(dds, blind = TRUE)
vst_counts <- assay(vst_data)
analysis<- DESeq(vst_counts)

At this step I always have this error:

Error in DESeq(vst_counts) : is(object, "DESeqDataSet") is not TRUE

How to correct that?

vst DESeq2 • 407 views
ADD COMMENT
0
Entering edit mode
## this creates the DESeq object from martix
dds <- DESeqDataSetFromMatrix (countData = countdata,
                               colData = metadata,
                               design = ~ Condition + Genotype)

## this runs the DESeq2 analysis as per your specified condition
dds <- DESeq(dds)
## you don't need to estimateSizeFactors manually because DESeq() does this as part of the pipeline

## returns the result from the DESeq analysis, you can specify the contrast specifically here - see the DESeq2 manual
dds.res <- results(dds)

## transforms the dds object using a variance stabilising transformation which converts the counts to a ~log2 type format
ddt <- vst(dds)

## returns the matrix of transformed ~log2 counts for downstream analysis & visualisation like PCA/TSNE/heatmaps etc
vst.mat <- assay(ddt)

As others have said, you should familiarise yourself with the DESeq2 manual, but this is a basic set of commands to doing a DESeq2 analysis.

Provided you've used the right contrast, dds.res contains information like LFC, standard error, p-value and adjuvsted p-value for the differentially expressed genes. You can convert it to a data-frame and immediately use it in visualisations like volcano-plots etc.

Just remember that DESeq2 will always require raw, untransformed counts for running differential analysis, and the rlog2/vst transformed data for downstream applications.

If you see:

dds <- estimateSizeFactors(dds)
vst_data <- vst(dds, blind = TRUE)

This is skipping the differential expression part and just generates ~log2 transformed data for downstream without doing any statistical testing.

ADD REPLY
1
Entering edit mode
6 weeks ago

Don't use vst counts in DESeq and instead provide a DESeqDataSet as is intended. VST counts should largely only be used for viz/downstream purposes.

ADD COMMENT
1
Entering edit mode
6 weeks ago
aUser ▴ 70

Hi, I think you first follow the DESeq2 tutorial to familiarize yourself with the protocol:

https://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html

In short, if you look at the "Quick start" section, you will come to know the flaw in your method.

ADD COMMENT

Login before adding your answer.

Traffic: 1928 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6