I think I am probably missing something obvious here with DESeq2. I used to use DESeq frequently to normalize count data but somehow cannot get the same process to work in DESeq2. I am able to create a DESeqDataSet object and run analysis with the DESeq function without difficulty, but then can't retrieve a normalized matrix of counts from a DESeqDataSet object following variance stabilization. The problem seems to be that the entry "counts" in the "assays" slot disappears after running varianceStabilizingTransformation.
Results:
Now trying variance stabilization, note that "counts" vanishes from the assays slot after running the function:
Code:
dds_blind=DESeqDataSetFromMatrix(countData=sample_otu_table,colData=BRR_env,formula(~1))
dds_blind<-DESeq(dds_blind,fitType=c("parametric"))
Code:
> dds_blind
class: DESeqDataSet
dim: 70232 92
exptData(0):
assays(1): counts
rownames(70232): OTU_1 OTU_3 ... OTU_46831 OTU_34574
rowData metadata column names(0):
colnames(92): 35 52 ... 211 281
colData names(5): collection_type block Zhao_name CGN crop
> dds_blind<-DESeq(dds_blind,fitType=c("parametric"))
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
> dds_blind
class: DESeqDataSet
dim: 70232 92
exptData(0):
assays(3): counts mu cooks
rownames(70232): OTU_1 OTU_3 ... OTU_46831 OTU_34574
rowData metadata column names(19): baseMean baseVar ... deviance maxCooks
colnames(92): 35 52 ... 211 281
colData names(6): collection_type block ... crop sizeFactor
Code:
> vsd<-varianceStabilizingTransformation(dds_blind,blind=TRUE) you had estimated gene-wise dispersions, removing these you had estimated fitted dispersions, removing these > vsd class: SummarizedExperiment dim: 70232 92 exptData(0): assays(1): '' rownames(70232): OTU_1 OTU_3 ... OTU_46831 OTU_34574 rowData metadata column names(23): baseMean baseVar ... dispGeneEstConv.1 dispFit colnames(92): 35 52 ... 211 281 colData names(6): collection_type block ... crop sizeFactor > getVarianceStabilizedData(vsd) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘dispersionFunction’ for signature ‘"SummarizedExperiment"’ > counts(vsd) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘counts’ for signature ‘"SummarizedExperiment"’
Comment