How to construct a SummarizedExperiment object?
1
0
Entering edit mode
Yijing • 0
@d0a8eb95
Last seen 13 months ago
Germany

Hello,

I am new to analysing RNA-seq data. I try to construct a SummarizedExperiment object for counts and metadata. On the tutorial, it only mentioned that "Often, SummarizedExperiment or RangedSummarizedExperiment objects are returned by functions written by other packages. " Does anyone know what other packages can be used for constructing SummarizedExperiment object?

SummarizedExperiment • 2.1k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 30 minutes ago
United States

If you plan to use DESeq2 to analyze your data, follow the vignette. The object you create inherits from the SummarizedExperiment class, and you can create it easily. If you are planning to use edgeR or limma, then you don't need a SummarizedExperiment.

ADD COMMENT
0
Entering edit mode

Thank you for your reply! But there are only procedures for creating DESeqDataSetFromTximport in the vignette, which seems not the SummarizedExperiment object I want. I do not quite understand what does this mean: The object you create inherits from the SummarizedExperiment class, and you can create it easily.

ADD REPLY
1
Entering edit mode

The vignette has procedures for four different input types, not just one! You can use a matrix of counts, or use tximport or an existing SummarizedExperiment object, or HT-Seq counts.

> library(DESeq2)
> example(DESeqDataSetFromMatrix )

DESDSF> countData <- matrix(1:100,ncol=4)

DESDSF> condition <- factor(c("A","A","B","B"))

DESDSF> dds <- DESeqDataSetFromMatrix(countData, DataFrame(condition), ~ condition)
> dds
class: DESeqDataSet 
dim: 25 4 
metadata(1): version
assays(1): counts
rownames: NULL
rowData names(0):
colnames: NULL
colData names(1): condition
> class(dds)
[1] "DESeqDataSet"
attr(,"package")
[1] "DESeq2"
> is(dds, "SummarizedExperiment")
[1] TRUE

The dds object inherits from SummarizedExperiment, and it was easy to make from a matrix of counts and a data.frame describing the data. Any object that inherits from SummarizedExperiment will act like a SummarizedExperiment so you don't have to care that it's actually a DESeqDataSet if you want to treat it like a SummarizedExperiment.

ADD REPLY
0
Entering edit mode

Hi James, thank you for your detailed explanation! Very clear!

ADD REPLY

Login before adding your answer.

Traffic: 806 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6