Exporting normalized counts data from DeSeq2
Hi,
I am working with large RNA-Seq dataset downloaded from the NCBI GEO. I would like to export the normalized counts data from DeSeq2 based on size factor normalization for further downstream analysis. It seems like running dds <- DESeq(dds) and dds <- estimateSizeFactors(dds) outputs the same results. Is my understanding correct? Please let me know if I could use any of these to export the normalized counts data.
library("DESeq2")
dds <- DESeqDataSetFromMatrix(countData = round(Counts_data), colData = sample_info, design = ~ Disease_state)
## 1
dds <- estimateSizeFactors(dds)
sizeFactors(dds)
normalized_counts <- counts(dds, normalized=TRUE)
write.csv(normalized_counts, file="normalized_counts.csv")
## 2
dds <- DESeq(dds)
sizeFactors(dds)
normalized_counts_DESeq <- counts(dds, normalized=TRUE)
write.csv(normalized_counts_DESeq, file="normalized_counts_DESeq.csv")
Created on 2021-09-20 by the [reprex package][1] (v2.0.1)
Thank you,
Toufiq
• 5,381 views
•
link
1 answer
It is the same:
> set.seed(1)
> dds <- makeExampleDESeqDataSet()
> all(counts(DESeq(dds), normalized=TRUE) == counts(estimateSizeFactors(dds), normalized=TRUE))
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
[1] TRUE
estimateSizeFactors runs as part of DESeq as, see the manual,
and ?DESeq:
(...)
This function performs a default analysis through the steps:
estimation of size factors: estimateSizeFactors
estimation of dispersion: estimateDispersions
Negative Binomial GLM fitting and Wald statistics: nbinomWaldTest
(...)
• 0 views
•
link
Log in to answer this question.