Entering edit mode
I have a conceptual question about the counts() function in DESeq2.
counts() uses a DESeq2 object as an input (usually called as dds). While creating this object, we can add covariates to the design formula. Let's say the formula is ~ genotype + age.
Does counts() generate normalized counts values corrected for covariates, or NOT considering the covariates?
Code example:
dds <- DESeqDataSetFromMatrix(countData = counts_mat, colData = samples, design = ~ genotype + age)
dds <- DESeq(dds, parallel = T)
counts(dds)
Alternatively you can just check the code.
But this gets into some inside baseball. For example, there is a function
assays
that you would need to know is an accessor function for aSummarizedExperiment
object that returns a list, one item of which should be called 'counts' socnts <- assays(object)[["counts"]]
is simply getting the counts data from theDESeqDataSet
without doing anything else to the data. So hypothetically you could look at the code and infer what is going on, and maybe learn something about how things work, which is useful.