This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Accessing data in within a DESeqDataSet class from DESeq2 library

I am new to R and using DESeqDataSet. I am following the example in 1.2.3 of this tutorial. So below are my commands:

>library(DESeq2)
>library("BIobase")
>library("pasilla")
>data("pasillaGenes")
>countData <- counts(pasillaGenes)
>colData <- pData(pasillaGenes)[,c("condition", "type")]
>dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design = ~condition)
>dds

class: DESeqDataSet 
dim: 14470 7 
metadata(0):
assays(1): counts
rownames(14470): FBgn0000003 FBgn0000008 ... FBgn0261574 FBgn0261575
rowRanges metadata column names(0):
colnames(7): treated1fb treated2fb ... untreated3fb untreated4fb
colData names(2): condition type

How can I access the data within dds? There is no countData(dds) or some other obvious public class function. Is the data now in a private class variable?

rna-seq r

1 answer

counts(dds)

How would I have known this? ?DESeqDataSet and printing out dds does not show it as a class member? Thanks!

counts() is a generic now, I think. Before that was the case, I remember it being mentioned as an accessor (i.e., a public method).

Edit: Yup, these accessors are now in the BiocGenerics package. One would have to have followed along with things for the past few years to have known that :(

Log in to answer this question.