Skip to contents

Force an object to belong to a class.


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)





logical(1). Perform command quietly, suppressing messages.


Additional arguments.


Modified object, of desired coercion type.


Updated 2022-03-07.

bcbioRNASeq to DESeqDataSet

  1. Coerce to RangedSummarizedExperiment.

  2. Round raw counts to integer matrix.

  3. Subset colData() to include only clean factor columns. See sampleData() for details.

  4. Simplify metadata() to include only relevant information and updates sessionInfo.

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

  1. Coerce to DESeqDataSet.

  2. Call DESeq2::DESeq().

  3. Call DESeq2::varianceStabilizingTransformation().

bcbioRNASeq to DGEList

When countsFromAbundance = "lengthScaledTPM" (default):

  1. Call edgeR::DGEList().

When countsFromAbundance = "no":

  1. Call edgeR::DGEList().

  2. Obtain per-observation scaling factors for length, adjusted to avoid changing the magnitude of the counts.

  3. Computing effective library sizes from scaled counts, to account for composition biases between samples.

  4. Combine effective library sizes with the length factors, and calculate offsets for a log-link GLM.

  5. Apply offset matrix using edgeR::scaleOffset().


Michael Steinbaugh



## bcbioRNASeq to DESeqDataSet ====
dds <- as.DESeqDataSet(bcb)
#> → Generating <DESeqDataSet> with DESeq2 1.36.0.
#>  Set the design formula with `design()` and run `DESeq()`.
#> [1] "DESeqDataSet"
#> attr(,"package")
#> [1] "DESeq2"

## bcbioRNASeq to DESeqTransform ====
dt <- as.DESeqTransform(bcb)
#> → Generating <DESeqDataSet> with DESeq2 1.36.0.
#>  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()`
#> [1] "DESeqTransform"
#> attr(,"package")
#> [1] "DESeq2"