Search
Question: [DESEQ2] How to access the normalized data of a DESeqDataSet
1
gravatar for john
2.7 years ago by
john40
Germany
john40 wrote:

Hello guys,

By  calling DESeq() on a DESeqDataset it estimates the size factors (normalization) automatically. How can I access this data? I must be stored somewhere. I would like to access the normalized counts.

>dds <- DESeq()

estimating size factors
estimating dispersions
gene-wise dispersion estimates

....

I know there is the counts() function but why use this if the calculation is already done?

## S4 method for signature 'DESeqDataSet'
     counts(object, normalized = FALSE)

 

Does anybody have any hints?

cheers,

John

 

ADD COMMENTlink modified 2.7 years ago by Steve Lianoglou12k • written 2.7 years ago by john40
2
gravatar for Michael Love
2.7 years ago by
Michael Love15k
United States
Michael Love15k wrote:

If you have a fresh dds, you can just do:

dds <- estimateSizeFactors(dds)
counts(dds, normalized=TRUE)

This is just dividing each column of 

counts(dds)

by

sizeFactors(dds)

You can pull up the help for all functions with:

help(package="DESeq2",help="html")

And there is a section of the vignette, "Access to all calculated values":

vignette("DESeq2")
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by Michael Love15k
0
gravatar for Steve Lianoglou
2.7 years ago by
Genentech
Steve Lianoglou12k wrote:

While Michael has answered your question "in spirit", allow me to provide an answer to your direct question:

  I know there is the counts() function but why use this if the calculation is already done?

Because the "normalized" data isn't actually stored anywhere. The only thing that is stored are the factors one can use to normalize the raw count data if required.

ADD COMMENTlink written 2.7 years ago by Steve Lianoglou12k

Yes, Steve's right. I missed this part of the question.

The point of the software and other count-based methods is to model the raw counts, so that estimation steps take into account the variance profile of counts. If you look over the methods, you'll see that almost all steps use K_ij which is the raw count for gene i and sample j. The normalized counts K_ij/s_j are only used to give each gene a single mean value for the dispersion trend regression (equation 5).

ADD REPLYlink written 2.7 years ago by Michael Love15k

Steve, Michael,

thanks that really helps me out and answeres my question. It takes quite some time to fully understand the DESeq2 package.

I have just downloaded the source code of the package. I found almost all functions like plotCounts() (which is in the "R" folder) but I still cannot find the counts() method. Where did you hide it? (-:

ADD REPLYlink written 2.7 years ago by john40
You can find function definitions in source code files in the R directory with grep "counts <-" *.R The counts method is defined in R/methods.R
ADD REPLYlink written 2.7 years ago by Michael Love15k

AH yes- I found this:

counts.DESeqDataSet <- function(object, normalized=FALSE) {

...}

Which is the same I guess.

 

ADD REPLYlink written 2.7 years ago by john40
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 314 users visited in the last hour