Force an object to belong to a class.
Usage
as.DESeqDataSet(x, ...)
as.DESeqTransform(x, ...)
as.DGEList(x, ...)
# S4 method for bcbioRNASeq
as.DESeqDataSet(x, quiet = FALSE)
# S4 method for bcbioRNASeq
as.DESeqTransform(x, quiet = FALSE)
# S4 method for bcbioRNASeq
as.DGEList(x, quiet = FALSE)
Arguments
- x
Object.
- quiet
logical(1)
. Perform command quietly, suppressing messages.- ...
Additional arguments.
bcbioRNASeq to DESeqDataSet
Coerce to
RangedSummarizedExperiment
.Round raw counts to
integer matrix
.Subset
colData()
to include only clean factor columns. SeesampleData()
for details.Simplify
metadata()
to include only relevant information and updatessessionInfo
.
Note that gene-level counts are required. Alternatively,
tximport::summarizeToGene()
can be called to convert transcript-level
counts to gene-level. By default, we're using length-scaled TPM, so a
corresponding average transcript length matrix isn't necessary. The average
transcript length matrix is only necessary when raw counts matrix isn't
scaled during tximport call (see countsFromAbundance
in
tximport::tximport()
documentation).
bcbioRNASeq to DESeqTransform
Coerce to
DESeqDataSet
.Call
DESeq2::DESeq()
.
bcbioRNASeq to DGEList
When countsFromAbundance = "lengthScaledTPM"
(default):
Call
edgeR::DGEList()
.
When countsFromAbundance = "no"
:
Call
edgeR::DGEList()
.Obtain per-observation scaling factors for length, adjusted to avoid changing the magnitude of the counts.
Computing effective library sizes from scaled counts, to account for composition biases between samples.
Combine effective library sizes with the length factors, and calculate offsets for a log-link GLM.
Apply offset matrix using
edgeR::scaleOffset()
.
Examples
data(bcb)
## bcbioRNASeq to DESeqDataSet ====
dds <- as.DESeqDataSet(bcb)
#> → Generating <DESeqDataSet> with DESeq2 1.42.1.
#> ℹ Set the design formula with `design()` and run `DESeq()`.
class(dds)
#> [1] "DESeqDataSet"
#> attr(,"package")
#> [1] "DESeq2"
## bcbioRNASeq to DESeqTransform ====
dt <- as.DESeqTransform(bcb)
#> → Generating <DESeqDataSet> with DESeq2 1.42.1.
#> ℹ Set the design formula with `design()` and run `DESeq()`.
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
#> → `varianceStabilizingTransformation()`
class(dt)
#> [1] "DESeqTransform"
#> attr(,"package")
#> [1] "DESeq2"